• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Form Submit Event Problem

vbresults

Well-known member
#1
I have a form with the AutoValidator class. I also have a jQuery.submit binding for this form, and I make the submit event return false if certain conditions are not met (to prevent the form from completing submission). The problem is that the XenForo jQuery.submit binding for the AutoValidator system ignores my return false and completes the form submission anyway. How can I resolve this issue?

Thank you. :)
 

Onimua

Well-known member
#2
Check for errors in the method you use to save the form data (specified in the form's action tag) and if there's an error, respond with this:
PHP:
// Do some error checking
 
if ($errors)
{
    return $this->responseError('Your error message');
}
And place that before where your data is saved to the database.