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
Post a Comment