-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set Defaults stopped working #1566
Comments
May I guess that you are using the updated jQuery version in noConflict mode? Could you please tell us exactly which versions of both libs you are using? Any errors? Which version worked correctly before? |
I am using jQuery v 2.1.4 and jQuery Validation v 1.14.0, no error and previously I used jQuery 2.0.3 and jQuery Validation 1.13.1. But latest libraries are working on jsfiddle. I have also tried to debug it, Here's my findings: // http://jqueryvalidation.org/jQuery.validator.setDefaults/
setDefaults: function( settings ) {
$.extend( $.validator.defaults, settings );
} At this point here is the $.validator.defaults and settings are after extending them $.extend it becomes this means that it have picked up my settings but it's not applying it(here's the generated html after validating): <div class="form-group">
<label class="col-sm-5 control-label">Experience <small>(in years) </small></label>
<div class="col-sm-7">
<input name="ctl00$ContentPlaceHolder1$EmployeeSkillExperience" type="text" maxlength="4" id="ctl00_ContentPlaceHolder1_EmployeeSkillExperience" class="form-control error" required="required" aria-required="true" aria-invalid="true">
<label id="ctl00_ContentPlaceHolder1_EmployeeSkillExperience-error" class="error" for="ctl00_ContentPlaceHolder1_EmployeeSkillExperience">This field is required.</label>
</div>
</div> It should have been like this: <div class="form-group has-error">
<label class="col-sm-5 control-label">Experience <small>(in years) </small></label>
<div class="col-sm-7">
<input name="ctl00$ContentPlaceHolder1$EmployeeSkillExperience" type="text" maxlength="4" id="ctl00_ContentPlaceHolder1_EmployeeSkillExperience" class="form-control" required="required" aria-required="true" aria-describedby="ctl00_ContentPlaceHolder1_EmployeeSkillExperience-error" aria-invalid="true">
<span id="ctl00_ContentPlaceHolder1_EmployeeSkillExperience-error" class="help-block">This field is required.</span>
</div>
</div> |
Did you make sure that the lib is not loaded twice? |
I am not sure how to check it. I have only wrote them onetime. On Fri, Sep 4, 2015 at 11:04 PM, Markus Staab notifications@github.com
Attiqe Ur Rehman |
@attiqeurrehman any news? Did you found the cause of the issue? |
Closing because no more feedback |
Hi,
I have recently did an upgrade of jQuery and jQuery Validation to the latest version of both. But this caused my defaults to stop working(validation is working) on some pages even though all pages share the same master page (where code is placed).
Here's the code:
The text was updated successfully, but these errors were encountered: