wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes How to submit through a dropdown menu. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to submit through a dropdown menu." Watch "How to submit through a dropdown menu." New topic
Author

How to submit through a dropdown menu.

Fritz Largosa
Ranch Hand

Joined: Sep 12, 2005
Posts: 70
Currently I have a dropdown menu and a submit button. After the user selects an item the user then clicks on submit botton which submits the results to Page2.jsp which processes it.

What I want is for the user to skip clicking the submit button and instead the page will auto submit whenever the user selects an item on the dropdown menu. Basically I do not want a submit botton but instead want the page to submit whenever the user selects an item from the dropdown menu.

I currently do not know how to implement this, if anybody knows how please help. Thanks.

My code
------------------------------------------------------------------------
<form name="form3" method="post" action = "http://localhost:8080/Page2.jsp">

<select name="select">
<%...Here is a JSP code which will populate my dropdown menu from the DB...%>

//after the user selects an item from the menu
//action = "http://localhost:8080/Page2.jsp" should be performed.

</select>

</form>

</body>
</html>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Some simple Javascript will do the trick.

Moved to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Try something like:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to submit through a dropdown menu.
 
Similar Threads
window without menu bar ...
How do I alter my dropdown menu?
How to display only selected amount of data from database in two dropdown lists?
generating tags when submit button in clicked
content of dropdown B will depend on what is selected on dropdown A