Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

maintaining state of Multiselect form select with ASP 2

Status
Not open for further replies.

sdh

Programmer
Apr 30, 2001
121
GB
I am looking to post a page back to itself for confirmation
and cannot find how to maintain the state of a select box which has multiselect set can anybody help PLEASE
 
So if you add the selected keyword to more than one <option > it doesn't work?
 
doesn't seem to

I am stuck!!
 
Yes it does - I've just checked it.
Code:
<select name="test" multiple>
<option value="" selected></option>
<option value=""></option>
<option value="" selected></option>
<option value=""></option>
<option value="" selected></option>
<option value=""></option>
</select>
This will have the 1st, 3rd and 5th option selected.

How are you building your select list? Is it dynamic or hard coded?

Can you post the code for it please.

Tony
_______________________________________________________________
 
Did you try selecting them with client side javascript? Is it possible to do a multi-select via code?

If that works then you could have some javascript function that is called by the page load event. If you are using form GET then it might be able to read from the querystring but if you are using POST then you'd have to use ASP to write part of the javascript.
 
Thanks Fester & sheco

I am building the list dynamically must be some syntax error
or something on my check if selected routine

I will look into it further
 
For completeness I realised the problem came when looping through the collection. I failed to assign the key to my condition statement.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top