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
Uncaught TypeError: b.each is not a function #401
Comments
To expound: that error is coming from the html5.js file on line 9 |
You should wait before calling $.validate() if you're dynamically adding stuff to the form on page load. Everytime you add new stuff to the form you will have to re-initiate the validation. Example: function addStuffToTheForm() {
// Inserting elements in the DOM
}
function setupValidation() {
$.validate({ ... });
}
$(window).on('load', function() {
addStuffToTheForm();
addStuffToTheForm();
addStuffToTheForm();
// Now we're finished creating the form, let's initiate the validation
setupValidation();
$('#some-button').on('click', function() {
addStuffToTheForm();
setupValidation();
});
}); |
Hi all. I have same issue, but my input isn't added dynamically
it shows the same error, and I tried many times to fix it |
I don't understand the config variable, are you also using the jsconf module? Could you please provide me with the markup of the form? |
I really need to see more code. This isn't enough for me to reproduce the error, it works fine http://jsbin.com/qetumezise/edit?html,console,output |
it shows error 2 times
|
Could you load html5.dev instead? |
it shows |
This should now be fixed. |
First off, thanks so much for this plugin! Very very cool!
Question: I have rows and elements that are dynamically added to the page. I need to make sure validation, sanitize, etc... apply to those new elements. The new elements all have the correct HTML attributes needed (data-sanitize="trim upper", etc...)
When I run this after I add a new row:
$.validate({form:'#myFormId', modules: 'html5, sanitize', validateOnBlur: false});
If get this error:
Uncaught TypeError: b.each is not a function
Ideas?
The text was updated successfully, but these errors were encountered: