0

drop down menu task
hi all i'm working in jsp & servlet project now i need a help in code for jsp page

I had a drop down menu which is dynamically reloaded from my database records waht i need is to link each item in the that menu to a different page(for each item there is a unique page)

example
i have a menu of course(java , db2 ,etc.....)
if i select java from the menu i want to open the page iclude the discription of that course

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by javaAddict
0

You can have a Submit button and when you select the menu, and press the button, you submit to a Servlet, take the value of the drop down box and according to that redirect:

<select name="menu">
<option value="java">Java</option>
</select>

When you submit and do request.getParameter("menu") It will return the "value" attribute of what you have selected.


Now if you don't want a submit button and you simply want when the user selects the menu from the drop down box use javascript:

<select name="menu" onchange="submit_the_form">
<option value="java">Java</option>
</select>

Have the drop down menu inside a form and in the onchange="" write javascript that submits the form

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.