BootstrapValidator form submit funktioniert nicht

Ich habe ein form mit 2 buttons. Ein button sendet das Formular in der ajax-format und ein weiterer button sendet das Formular in der normalen Mode.

$('#form_createAd').bootstrapValidator({
    submitHandler: function(validator, form, submitButton) {
        if (submitButton.attr('value') == "cart"){
            submit_cartDetails(); //This function submits details thru ajax post
        } else {
            form.submit(); //Also Tried $('#form_createAd').submit()
        }
    }, fields: {
        title: {
            message: 'The username is not valid',
            validators: {
                notEmpty: {
                    message: 'The username is required and can\'t be empty'
                },
                stringLength: {
                    min: 6,
                    max: 30,
                    message: 'The username must be more than 6 and less than 30 characters long'
                },
                regexp: {
                    regexp: /^[a-zA-Z0-9_\.]+$/,
                    message: 'The username can only consist of alphabetical, number, dot and underscore'
                }
            }
        }
    }
});

Dies Ist Der HTML-Teil Der Schaltflächen in Form Abschnitt

<button  id="cart" value="cart" class="btn btn-primary" >Add To Cart</button>             
<button type="submit" name="submit" value="proceed" class="btn btn-success">Proceed</button>

Das Formular nicht Absenden. Was habe ich falsch gemacht?

  • Bitte achtsamer, wenn das tagging Ihrer Frage. jquery-validate - plugin ist nicht der gleiche wie der Bootstrap-Validator-plugin.
  • Ich habe die Verkleidung gleiche problem mit ihm. Mit BootstrapValidator 0.5.1
Schreibe einen Kommentar