jsp - How to get the selected value of select option using java code -


i'm studying java web. , now, have question that. code in jsp file:

<select id="ddlfruits" name="ddlfruits" onchange="getselectedtextvalue()">    <option value="0">banana</option>    <option value="1">apple</option>    <option value="2">mango</option>    <option value="3">orange</option> </select>  <script type="text/javascript">     function getselectedtextvalue() {         var t = document.getelementbyid("ddlfruits");                 var fruitsid = t.options[t.selectedindex].value;         <%              // how value of fruitsid in here???               // fruitsid.          %> } </script> 

how selected value of select option (variable : fruitsid ) in <% // java code %>. used code: request.getparameter("fruitsid "). returned null. advance!


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -