Webpage forms help

Discussion in 'OT Technology' started by debosteebo, Sep 23, 2003.

  1. debosteebo

    debosteebo New Member

    Apr 8, 2002
    Likes Received:
    south central la palma
    how do you make it so after you hit submit a form, the characters entered by the user will remain in the textfields if the user wishes to go back to edit entries?
  2. crotchfruit

    crotchfruit Guest

    depends on which language you're using..

    however, the concept is pretty simple. basically, when the user hits the submit button the target page is going to get GET/POST data associated with the form.

    so, when the script sees that there's an error and wants to refill the forms, you have to set the default values of the input fields to what they were sent in as GET/POST.

    for example, on the first page you have this:

    <input type=text name="myname">

    so the user files out his name and hits submit. oops! the name must be longer than 2 characters.

    so you get the name string they tried to submit, and when you're regenerating the page you put it in the form yourself:

    <input type=text name="myname" value="$oldname">

    where $oldname is the string that they tried to submit.

  3. CompiledMonkey

    CompiledMonkey New Member

    Oct 26, 2001
    Likes Received:
    Richmond, VA
    Yeah, it really does depend on which programming language you're using. Post that and get back to us.
  4. and if your user is using the back button, you just might be screwed. so clear the history using history.go(+1) on the form page to hopefully disable the back button on the results page.

Share This Page