SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Users have to re-add a password when they click their back button

    In my registration form the user adds a password they want to use, along with other information. However, if there is an error when the form is processed, the directions ask them to click their browser back button and resolve it. This, unfortunately, always deletes the password they originally chose to use. Is there anyway to keep the password from being deleted by default? Is this an HTML issue or a browser issue?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,181
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Utilize a session:

    Code PHP:
    //myForm.php
    <?php
    session_start();
    if(isset($_POST['submittedForm'])) {
    $_SESSION['formInfo'] = $_POST['submittedForm'] //sessions survive multiple http requests.
    //do all your stuff
    } else {
    //display your form, action should equal PHP_SELF
    }

    Not that, even you use PHP_SELF for the action of your form, you dont even need to utilize a session, and you can place all the fields back into their boxes right from $_POST

  3. #3
    SitePoint Member imsas's Avatar
    Join Date
    Feb 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Note that if you have labeled the input type as "password" within your form most browsers will not keep the value and will just display a blank.. This is mostly for security reasons.. There is really no way to keep the entered info in an input type "password".. I would recommend changing the form input type to "text" and then using Javascript to mask the entered text onkeyup..
    ___________________________________________________________________
    IMSAS Background Check - Background Check API
    PeopleSearchWorld.com - People Search
    fuzwire.com - Job Search

  4. #4
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,181
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by imsas View Post
    Note that if you have labeled the input type as "password" within your form most browsers will not keep the value and will just display a blank.. This is mostly for security reasons.. There is really no way to keep the entered info in an input type "password".. I would recommend changing the form input type to "text" and then using Javascript to mask the entered text onkeyup..
    Eww no. I didn't see he was talking about a password. Make them re-enter this, or: do your checks with AJAX before leaving the page.


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
  •