The problem I am facing is that it displays the required error message but even after displaying the error message, it redirects to the Thank You page. Can You guys help make it work as required? I do understand Symfony,HTML and JS but am no expert. I am learning by doing and hence would appreciate a little elaborated answer
The form tag used:
<form name="myForm" method="post" enctype="multipart/form-data" action="/module/templateSubmit">
onclick event of submit:
function Name(){
var isError= false;
error="Error Text";
....validation conditions that set isError=True on failed validation.....
if(isError){
document.getElementById('errorDiv').innerHTML=error;
document.getElementById('errorDiv').style.display='block';
}
else{
document.loadlist.submit();
}
***where errorDiv is the div ID where error message is displayed on the form page
action for templateSubmit:
$this->redirect('module/ThankYouTemplate');
action for ThnakYouTemplate:
return sfView::SUCCESS;
I guess that is all the info you need. If at all more information is required, just let me know.
Thank You
