Jump to content

Form fields, checkboxes, and radio button lose data on refresh


Recommended Posts

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

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).

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.

 

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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.