...

View Full Version : selected option problem



gtriant
09-26-2006, 10:39 AM
Hi!
I have a drop down menu created with a select tag and i have the following values in it:
1. "All", for selecting alltogether the values (for query purposes)
2. The rest of the values which come with a query from a database.

Each time I enter the page I want to have selected as a first option, the previous selection and if there is no previous selection (firts time into the page or never used the menu before), I want pre-selected the "All" option.
The code up to now -without using the "selected" attribute- looks like this:

<form action="###" method="post">
<select>
<option value="0">All</option>
<c:forEach var="row" intems=.......>
<option value="row.value">row.name</option>
</c:ForEach>
</select>
</form>

I am close to the answer with a script, but i am not at all good using them!

I would appreciate any help.

gtriant
09-26-2006, 12:16 PM
never mind, i got it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum