$(object).each IE bug?
$(object).each IE bug?
Im trying to traverse elements in a form to validate the form.
Rather than posting the entire code i will post a test i did.
-
//checkFormFields called when a form is submitted
function checkFormFields(form) {
var formFields = form.elements;
$(formFields).each(function(i){
alert(i);
});
}
so the alert should display the index of the current form element in the loop. For some reason in IE the loop only happens once, that is i get an alert for the first element but not the rest and the length of formFields is 5.
EDIT: Works in FF. Does not work in IE 6 & 7.