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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.