Persistant form data

Results 1 to 2 of 2

Thread: Persistant form data

  1. #1
    BillB Guest

    Default Persistant form data

    I have a form with a mix of text boxes and list boxes. When the submit button is pressed, I call an ASP page that checks the validity of each of the entries in the form fields. My problem is that if an error is found in one of the fields, it returns the user to the form page returning the information that was entered back into the form fields except for the information that was entered in the list boxes. I can not seem to get the information back into the list boxes. It returns them to the default value for the list box data. Any ideas on what I am leaving out? Thank you.

  2. #2
    Join Date
    Dec 1969

    Default RE: Persistant [sic] form data

    How do you restore the other form information?<BR><BR>Presumably by doing something like:<BR><BR>&#060;INPUT Type=Text Name="Whatever" Value="&#060;% = Request.Form("Whatever") %&#062;" &#062;<BR><BR>yes?<BR><BR>Okay, with a &#060;SELECT&#062; list, the "secret" is that you must put the word SELECTED into the &#060;OPTION&#062; that matches the prior choice.<BR><BR>SO you could do:<BR><BR>&#060;SELECT Name="theSelect"&#062;<BR>&#060;OPTION Value="xyz" &#060;% If Request("theSelect") = "xyz" Then Response.Write "SELECTED" &#062; ...<BR>&#060;OPTION Value="abc" &#060;% If Request("theSelect") = "abc" Then Response.Write "SELECTED" &#062; ...<BR>...<BR>&#060;/SELECT&#062;<BR><BR>Hopefully, you can see how you could write a loop in your ASP code to do that more efficiently, but the principal is the same no matter what you do.<BR><BR>

Posting Permissions

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