Hi Guys
I am trying to get validate to work, but I am soo close and yet soo
far!
I think the problem is the selector and way i append the error or
valid classes to the label, or specify the element for errors?
Can anyone see the mismatch or problem?
HTML example...
[code]Company Name:
error_array['company_name']; ?>
[/code]
where the inputrightdiv is what holds my todo image,
then i want it replaced with inputrightdiv-valid which shows my nice
green tick image!
Jquery Validation initialization( i have taken out extra options for
simplicity )...
[code]
$(document).ready(function() {
// validate signup form on keyup and submit
var validator = $("#recruiter_signup").validate({
rules: {
CompanyName: "required"
},
messages: {
CompanyName: "Please ensure you have entered your
company name."
},
// the errorPlacement has to take the table layout into account
errorPlacement: function(error, element) {
error.appendTo(element.parent().parent());
},
// Set Error Element
errorElement: "div.inputrightdiv",
// Focus in textbox
focusInvalid: false,// show all form error at a time
// Set Error Class
//errorClass: "error",
errorClass:"inputrightdiv-error",
// specifying a submitHandler prevents the default submit, good
for
the demo
submitHandler: function() {
alert("submitted!");
},
// set this class to error-labels to indicate valid fields
success: function(label) {
label.addClass('inputrightdiv-valid');
}
});
});
[/code]
thanks for any tips or eagle eyes :)