c# - My form is submitting automatically even validations shows errors in asp.net -
i'm using bootstrap validations webform in asp.net, i'm using html controls only. when i'm submitting form form submitted validation fails. don't know why happening that.
i'm new bootstrap validations. had started using validations through following link http://formvalidation.io/download/. here i'm trying when submit form first has check validations , if validations gone perfect has submit form server. if there field blank form should not submitted.
i had searched problem on web, can't understand saying. i'm new javascript , jquery, here links suggested:
http://formvalidation.io/examples/cant-submit-form-after-validation/
here i'm using asp.net c# send values server.
<form id="form1" name="form1" runat="server"> <input type="text" class="form-control" name="user" id="user" /> <input type="text" class="form-control" name="pass" id="pass" /> <input type="submit" name="signup" id="signup" runat="server" /> </form> $(document).ready(function() { $('#form1').formvalidation({ framework: 'bootstrap', icon: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: { user: { row: '.col-lg-3', validators: { notempty: { message: 'please enter username' }, regexp: { regexp: /^[a-za-z]+$/, message: 'user name should alphabets' } } }, pass: { row: '.col-lg-3', validators: { notempty: { message: 'please enter password' }, regexp: { regexp: /^[a-za-z ]+$/, message: 'pass should alphabets' } } } } }); }); protected void submit_serverclick1(object sender, eventargs e) { response.redirect("home.aspx",false); }
Comments
Post a Comment