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!

Utilize a session:


//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

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.