Hmmmm....but you could try something where you kind of 'fool' your
visitor. When the page resubmits to itself, if there's an option in the
list box selected you could write a list box populated ONLY with
selected values - each with the SELECTED spec in the <option> tag. Then
provide the user when a CHANGE or CLEAR button that resubmits back to
the page, but with a querystring value that tells the page to draw the
list box with ALL possible values.
EVENT: Initial Page Load
ACTION: Populate list box with all possible values
EVENT: Self-submit - no value in the querystring or no values selected
ACTION: Populate list box with all possible values
EVENT: Self-submit - no value in the querystring, but values selected
ACTION: Populate list box with values from the request with each one
having the SELECT specified
Show the CHANGE/CLEAR button
EVENT: Self-submit - value in the querystring
ACTION: Populate list box with all possible values
I'm a bit frazzeled from work but at least that might get you going in
the right direction.
David H
James Baker wrote:
Thanks for the reply. Only issue I have with that 'selected' issue is, I
have a multi-select box. Am I SOL?
"David C. Holley" <Da**********@n etscape.net> wrote in message
news:u1******** ******@TK2MSFTN GP11.phx.gbl...
The only solution that I found was to write the VALUE using
value=<%respo nse.write request("userNa me")%>. For the list boxes, I
chopped of the HTML into two segments such as...
<%if request("airlin e") <> "" then%>
<option value="<%respon se.write request("airlin e")%>"<%respons e.write
request("airl ine")</option>
<%else if%>
<option value="">---Select Airline---</option>
<%end if%>
[rest of the option's here]
This puts the selected option at the top of the list.
I STRONGLY recommend avoiding the specifying which options is SELECTED.
I had mutliple problems with this when I was testing across different
browsers with and without the a particular option selected. Writing the
value from the request as the first option achieves the same effect as
if it were written using SELECTED.
David H
James Baker wrote:
I have a form that has a dropdown list that will cause a post to the
same
page when it's changed. The problem I'm running into is that all of the
controls reset to their default values (obviously expected behavior).
What's the recommended/best way to persist these values through the post
process? I know I could set them to the request.form values of
themselves,
so to speak...but I didn't know if there was a simpler/more efficient
way.
Thanks,
James