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

Form Submit Event Problem

Discussion in 'XenForo Development Discussions' started by vbresults, Nov 9, 2011.

  1. vbresults

    vbresults Well-Known Member

    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. :)
     
  2. Onimua

    Onimua Well-Known Member

    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.
     
    LancerForHire likes this.

Share This Page