Default Values AND Retain Data

Results 1 to 2 of 2

Thread: Default Values AND Retain Data

  1. #1
    Richard Brust Guest

    Default Default Values AND Retain Data

    The app that I have has 6-7 pages, each page with form elements (text box, drop down, radio button, etc), and a Next button that saves the form elements when going from page to page. The pages also have a back button that when you go back to the previous page, that pages elements get populated with the values you had already entered. However, if i enter default values in the drop down boxes, when you go back the default values re-initialize rather than keep your choice, which is the correct behavior, that I do not question.<BR>What I would like, however, is to present the user with default vals, but also retain their choices if they go back pages. Yes, I want it all...<BR><BR>p.s. the app is a representation of the idea from<BR>in case you want to see the code.

  2. #2
    Join Date
    Dec 1969

    Default RE: Default Values AND Retain Data

    I am assuming that you are passing these in a QueryString type of method.<BR><BR>What I would do is test for the QueryString value first and if it&#039s blank then set the default value. <BR><BR>i.e.<BR><BR>&#060;input type="text" name="field1" id="field1" value="&#060;%If Request.QueryString("Field1") &#060;&#062; "" then Response.write Request.QuerySTring("Field1") else Response.write {DefaultValue} End If%&#062;"&#062;<BR><BR>This code could be cleaned up with some variables but that&#039s how you test if they are moving backwards

Posting Permissions

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