javascript - I get jQuery error while submitting my bootstrap form -
I have a small registration form and I try to submit this form using the bootstrap submitHandler, But he can not read the attribute of 'zero' attribute to the I use this code to validate and submit: Why do I get that error? When I remove submitHandler, I do not get that error, but I need to store the form data in my database. The data is valid but not submitted. I also have For me html: Please see this page properly by submitting a form through Ajax : Uncaught TypeError: zero. .
$ (document) .ready (function () {// validating the registration form And save the value after verification $ ('# Register Form'). BootstrapValidator ({Message: 'This value is not valid,' Feedback Echoes: {Valid: 'Glyphikon Glyphikon-OK', invalid: 'Glyphicon glyphicon- With ', valid:' glyphicon glyphicon-refresh '}, field: {email: {validator: {notEmpty: {message:' email is required and Person can not be '}, email address: {message:' input is not a valid email address'}}}, password: {valid: {notEmpty: {message: 'password is required and can not be empty}' }}, Confirm Password: {validators: {notEmpty: {message: 'The password is required and can not be empty}}}, submit handler: function (form) {// <- lt; - only occurs When the form is valid $ .exx ({type: 'post', url: 'include-ajax / check_and_save_registry_form.fp'), day Class: $ (form).), Success: function () {$ (form). Fedot (500, function) ($ (form). Html ( "User"). Fadein (); }); }}); // & lt; - End '.jax ()' return false; // & amp; Lt; - Block default form action}}}}; });
SubmitHandler: function (validator, form, submitButton) . Still giving the same error How to get the form without error?
& lt; Div class = "pages_container" & gt; & Lt; Form id = "registerForm" method = "post" class = "form-horizontal" & gt; & Lt; Div class = "form-group" & gt; & Lt; Label class = "col-lg-3 control-label" & gt; Email address & lt; / Label & gt; & Lt; Div class = "col-lg-6" & gt; & Lt; Input class = "form-control" name = "email" type = "email" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" & gt; & Lt; Label class = "col-lg-3 control-label" & gt; Password & lt; / Label & gt; & Lt; Div class = "col-lg-6" & gt; & Lt; Input type = "password" class = "form-control" name = "password" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" & gt; & Lt; Label class = "col-lg-3 control-label" & gt; Retype password & lt; / Label & gt; & Lt; Div class = "col-lg-6" & gt; & Lt; Input type = "password" class = "form-control" name = "confirmation password" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" & gt; & Lt; Div class = "col-lg-6 col-lg-offset-3" & gt; & Lt; Button type = "submit" class = "BTN BTN-Primary BTN-LG BTN-Block" & gt; Register & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Div & gt;
$ (document) .ready (function () {$ (form) .bootstrapValidator ({... options ...}) .on ('success.form.bv', Function) {// Stop the form submission.Enter example of e.preventDefault (); // get form var $ form = $ (e.target); // BootstrapValidator Example var bv = $ form.data ('bootstrapValidator') ; / / Submit $ .oz form data $ .post data ($ form.attr ('verb'), $ form.serialize (), function (result) {// ... Riya ...}, 'json');});});
Comments
Post a Comment