Jump to content

Refresh to submit


samona

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.