dmccabe Posted April 1, 2008 Share Posted April 1, 2008 I have a large form that users need to fill in on my intranet. I have put some basic error checking in to make sure they fill in in all the fields correctly which works well, however when they click submit and it reloads the page with the error stating "You must fill in all fields" it re-loads the blank form. How can I make it so all the info they just typed is still there? Link to comment https://forums.phpfreaks.com/topic/98965-reload-form-with-existing-values/ Share on other sites More sharing options...
zenag Posted April 1, 2008 Share Posted April 1, 2008 how did u check errors?using javascript or php? Link to comment https://forums.phpfreaks.com/topic/98965-reload-form-with-existing-values/#findComment-506376 Share on other sites More sharing options...
dmccabe Posted April 1, 2008 Author Share Posted April 1, 2008 php if (blah == NULL) { blah } that kind of thing Link to comment https://forums.phpfreaks.com/topic/98965-reload-form-with-existing-values/#findComment-506399 Share on other sites More sharing options...
cooldude832 Posted April 1, 2008 Share Posted April 1, 2008 to repopulate a form you need to assign values to the inputs <input type="text" name="input1" value="" /> becomes <?php echo "<input type=\"text\" name=\"input1\" value=\""; if(isset($_POST['input1'])){echo $_POST['input1'];} echo "\" />"; ?> Link to comment https://forums.phpfreaks.com/topic/98965-reload-form-with-existing-values/#findComment-506404 Share on other sites More sharing options...
dmccabe Posted April 1, 2008 Author Share Posted April 1, 2008 Excellent I will give it a shot thanks Link to comment https://forums.phpfreaks.com/topic/98965-reload-form-with-existing-values/#findComment-506411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.