SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,416
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you make sure that the form keeps it's contents when going back to it ?

    Not sure what it's called, but what's the code that you put into the page, to ensure that when you complete a form, and it may be completed wrongly and then the next page, says something long the lines of you've not completed the form correctly, press your go back button to complete, but when you go back to the form, the previous contents are still there - not the ones where you have to start all over again on what can be lengthy forms.

    Any help much appreciated.

    Dez.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,042
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    Any server side language of your choice.
    The only code I hate more than my own is everyone else's.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Generate and deliver the markup for the empty form, server-side.
    2. When user submits, receive the results and validate, server-side.
    3. If valid, redirect to confirmation/acknowledgement page, server-side.
    4. If invalid, generate and deliver the markup for the filled-in form, server-side.
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,416
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oddz View Post
    Any server side language of your choice.
    Many thanks.

  5. #5
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,416
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    1. Generate and deliver the markup for the empty form, server-side.
    2. When user submits, receive the results and validate, server-side.
    3. If valid, redirect to confirmation/acknowledgement page, server-side.
    4. If invalid, generate and deliver the markup for the filled-in form, server-side.
    Many thanks Tommy - that's useful to know the actual process - do you know if there's anywhere on the web, where I can learn more of that please ? Unless anyone can kindly put a sample of the code here ?

    Any help always appreciated.

    Dez.

  6. #6
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,042
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    It varies based on the server side language – ASP,PHP,Ruby,Python,Java?

    using PHP it would be something like:

    PHP Code:
    $value = isset($_POST['name'])?' value="'.$_POST['name'].'"':'';

    echo 
    '<input type="text" name="name"',$value,'>'
    simple example
    The only code I hate more than my own is everyone else's.

  7. #7
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,416
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oddz View Post
    It varies based on the server side language ASP,PHP,Ruby,Python,Java?

    using PHP it would be something like:

    PHP Code:
    $value = isset($_POST['name'])?' value="'.$_POST['name'].'"':'';

    echo 
    '<input type="text" name="name"',$value,'>'
    simple example
    Thanks Oddz, it's appreciated - at the moment, it's FormMail - (I know it's not very secure).


Bookmarks

Posting Permissions

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