I'm using jquery validation to validate a form the js code looks like this:
form.validate({
messages: {
years_of_experience: {
range: "<?php echo Translation::tr('profileform.error.yearsOfExperience');?>"
}
},
rules: {
years_of_experience: {
range: [0, 100]
}
}
});
Translation::tr('profileform.error.yearsOfExperience') -> makes a simple mysql call to the database and returns a string (the error message for the element) but the problem is that i can't display the error message (i get blank).
if i change the javasctipt code like this it works just fine:
form.validate({
messages: {
years_of_experience: {
range: "Please select a number from 0 to 100"
}
},
rules: {
years_of_experience: {
range: [0, 100]
}
}
});
Can you help me ?
Thanks