Scott B Posted October 8, 2011 Share Posted October 8, 2011 I have created a pretty extensive form. The problem I am having is that if one of the required fields isn’t filled out and you submit the form, it comes up with the error message but it erases all the other entries that were made, except the required fields. Is there a way to keep that info in place so a person doesn’t have to fill out all these fields again? Please help, I’m still fairly new to PHP and have tried numerous things but none have worked. Thanks, Scott Quote Link to comment https://forums.phpfreaks.com/topic/248712-form-fields-checkboxes-and-radio-button-lose-data-on-refresh/ Share on other sites More sharing options...
Psycho Posted October 9, 2011 Share Posted October 9, 2011 Yes. When the page is submitted, and there is a validation error, you need to repopulate the fields based upon what the user submitted. How you would do this would be based on the current logic of your page(s). Quote Link to comment https://forums.phpfreaks.com/topic/248712-form-fields-checkboxes-and-radio-button-lose-data-on-refresh/#findComment-1277317 Share on other sites More sharing options...
Scott B Posted October 9, 2011 Author Share Posted October 9, 2011 As I mentioned I am still new to PHP, I stumbled through a tutorial to get this far. Here is what I have so far https://www.securityinvestinggroup.com/SIG/contact/contactform2.php Any help would be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/248712-form-fields-checkboxes-and-radio-button-lose-data-on-refresh/#findComment-1277327 Share on other sites More sharing options...
Psycho Posted October 9, 2011 Share Posted October 9, 2011 Where is your code? Quote Link to comment https://forums.phpfreaks.com/topic/248712-form-fields-checkboxes-and-radio-button-lose-data-on-refresh/#findComment-1277337 Share on other sites More sharing options...
Scott B Posted October 9, 2011 Author Share Posted October 9, 2011 Hey mjdamato, I really appreciate you trying to help me out. However, I have found a solution. I was simply missing the <?php echo $_POST['somename']; ?> in the value field. Something very basic of course. Thanks again, Scott Quote Link to comment https://forums.phpfreaks.com/topic/248712-form-fields-checkboxes-and-radio-button-lose-data-on-refresh/#findComment-1277340 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.