I am creating a page in JSP where I have a dropdown list and once the user selects a value he has to click on the go button and then the value is sent to the Servlet.
</select> <input type="submit" name="GO" value="Go"/>
How do I make it so that it does it on change? E.g. when the user selects John all his details are retrived from the DB and displayed. I want the system to do it without having to click the go button.
The <select> tag is used to create a drop-down list in HTML, with the <option> tag. Used to give a name to the control which is sent to the server to be recognized and get the value. This can be used to present a scrolling list box. If set to "multiple" then allows a user to select multiple items from the menu.
Just ask assistance of JavaScript.
<select onchange="this.form.submit()"> ... </select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With