samona Posted June 2, 2008 Share Posted June 2, 2008 Hi all, I have a problem with a form I wrote in PHP. It check to see if any input producess an error, and if so it displays an error message. However, inorder for the user to resubmit the form, he must refresh the page. Anyone know what the problem could be? Thx! Link to comment https://forums.phpfreaks.com/topic/108300-refresh-to-submit/ Share on other sites More sharing options...
haku Posted June 2, 2008 Share Posted June 2, 2008 More details please. I don't understand what the problem is. Link to comment https://forums.phpfreaks.com/topic/108300-refresh-to-submit/#findComment-555252 Share on other sites More sharing options...
samona Posted June 2, 2008 Author Share Posted June 2, 2008 I have a form that a user fills out. If the user doesn't fill a required field then the page will redirect to an error page. When the user hits the back button on the browser to fill in the missing field, and tries to hit the submit button again, it doesn't work. The page has to be refreshed in order for the submit button to work. Link to comment https://forums.phpfreaks.com/topic/108300-refresh-to-submit/#findComment-555258 Share on other sites More sharing options...
haku Posted June 2, 2008 Share Posted June 2, 2008 Are you using javascript or something to submit your form? Post the code for the form page, and for the form processing. Link to comment https://forums.phpfreaks.com/topic/108300-refresh-to-submit/#findComment-555297 Share on other sites More sharing options...
samona Posted June 2, 2008 Author Share Posted June 2, 2008 No I'm not using javascript. I'm using ITX Template The code in the form checks for errors in the input of the form . . . if(empty($thirty) || !(is_numeric($thirty))) { $errors = true; } if ($errors) { $template->setCurrentBlock("error"); $template->setVariable("ERROR", "Bad Input"); $template->parseCurrentBlock("error"); $template->show(); exit; } //If no errors then the code moves on to insert the record in the database. The following is the error page template that is outputted with $template->show(); When you get to the following page, clicking back takes you to the form but you have to refresh the form in order for the submit button to work. <html><body> <!-- BEGIN error --> <h1>{ERROR}</h1> <!-- END error --> </body></html> When a user hits the back button from the error page to get back to the form, he has to refresh the page in order for the form to get processed again. Link to comment https://forums.phpfreaks.com/topic/108300-refresh-to-submit/#findComment-555324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.