Form Validation working in FF but not in IE8
Hello All,
Following is my code snippet .... (This is a function which checks if the password fields are empty then throws the validation message.
$("#passwordForm").validate({
rules: {
newPassword: { required:
true },
confirmNewPassword: { required:
true ,equalTo:"#newPassword" }
},
messages: {
newPassword: { required:
"This is a required field." },
confirmNewPassword: { required:
"This is a required field." }
},
/* error placement configuration */
errorElement:
"div",
errorPlacement:
function(error, element) {
// test to see if element has associated label; if so then use the label for placement of error message instead
elementName = element.attr(
'name');
testElement = $(
"#" + elementName + "Label");
if ( testElement.length > 0 ) {
element = testElement;
}
offset = element.offset();
error.insertBefore(element)
error.addClass(
'message'); // add a class to the wrapper
error.css(
'position', 'absolute');
error.css(
'left', offset.left + element.outerWidth() );
error.css(
'top', offset.top -10);
}
});
The above snippet works correclty in mozila firefox , but while working with IE8 the validation is not happening...
Can some 1 please help?
Thanks in advance
kausty05
