jquery - Call Ajax when click button submit with validationform.io -


i use plugin jquery : "validationform" in site : http://formvalidation.io/. when click button submit, call ajax server. in here plugin validationform don't validate fields,but call ajax. code :

html:

<button type="submit" class"btn btn-success" id="#button"></button> 

validationform code:

$('#form').bootstrapvalidator({             message: 'not valid',             feedbackicons: {                 valid: 'glyphicon glyphicon-ok',                 invalid: 'glyphicon glyphicon-remove',                 validating: 'glyphicon glyphicon-refresh'             },             fields: {                 phonenumber: {                     message: 'not null',                     validators: {                         notempty: {                             message: 'not null'                         },                         stringlength: {                             min: 2,                             max: 100,                             message: '2->100 characters'                         },                     }                 }             }         })          ; 

jquery: event click button submit

$('#button').click(function(e){        e.preventdefault();        $.ajax({         //....        }) }); 

i want check validation form before submit form ajax.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -