i have a drop box with static values and i i have made a EDIT.jsp page now which will show the values i stored in the database and i want them to be shown in a drop list as a default value consider there are 4 elements
<select name="language">
<option value="1">c++</option>
<option value="2">php</option>
<option value="3">.net</option>
<option value="4">java</option>
i want if the value in the database table is 3 then when the page loads the default value should be as shown in the drop list be
<select name="language">
<option value="3">.net</option>
<option value="1">c++</option>
<option value="2">php</option>
<option value="4">java</option>
and i can’t use jquery in this…i want a solution preferably in java
i tried using value attribute and javascript but it sis nt work…i am new to java so i could nt figute out how to pass java scriplets in javascript if they r possible…i am making a Online examination system for my 2nd year engineering project
please help!!
You have to use selected attribute of option tag.
get the value which is stored in the database and, put them in select box