drop down list

Results 1 to 2 of 2

Thread: drop down list

  1. #1
    alf Guest

    Default drop down list

    I have an ASP page that posts to itself and performs field validation on the server side before sending the data to the dB. One of the fields is State and it is a drop down select with all the State names. For the other fields I simply set their values="<%=Session("fieldName")%>" so the user does not lose the value they entered if they made a mistake somewhere on the form. How can I do this with the State field??

  2. #2
    Sathiya Guest

    Default RE: drop down list

    I can give you the code but test it before implementing<BR>save the stateId or Name in session for this example i am storing in StateID ok &#060;%=Session("StateID") when the user comes back in the option tag.<BR>&#060;option value="&#060;%=rs("StateID")%&#062;" &#060;% If Session("stateID") = rs("StateID") Then %&#062; Selected &#060;% End If %&#062;&#062;&#060;%=rs("StateID")&#060;/option&#062;<BR>in this example i am getting state from a drop down, if you are typing all the states then u may have some pain in typing the If statement more time, replace the rs("StateID") with your relevant state and

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts