Validation Message does not appear
(December 2, 2011)
"When i submit a form with a wrong code i don't get the red warning. "
Question
When i try to submit the form with a wrong captcha the form does not submit but i don't get the red warning. What am i doing wrong?
Answer
Please make sure your form is using method="POST" and action="action_url_goes_here" points to your current page!
Then add to your page:
FOR PHP:
if($_SERVER['REQUEST_METHOD'] == "POST") { // if form is submitted
if (!isset($mm_abort_edit) || !$mm_abort_edit) { // and validation is fine
$GoTo = "thank_you.php"; // redirect to a new page
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$GoTo .= (strpos($GoTo, '?')) ? "&" : "?";
$GoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $GoTo));
}
}
FOR ASP:
if Request.ServerVariables("REQUEST_METHOD") = "POST" then 'if form is submitted
If eval("vartype(MM_abortEdit)") = 0 or (Not MM_abortEdit) Then 'and validated
Response.Redirect "thank_you.asp" 'redirect to a new page
end if
end if
Teodor Kuduschiev
Working as a Q&A Engineer at Dynamic Zones International BV. Along with the support and the forums, he's taking time to create awesome designs.
User Reviews
Total of 1 reviewquestion - don't understand your answer
Written by j koester on April 18, 2012sorry, but I don't understand WHERE I'm supposed to add this... I tried adding immediately after POST, I also tried adding at beginning of page, like this, neither worked. can you give a few more details for us newbies? <!--#include ...









