Custom validation message - javascript

rovell74 17 Dec, 2014
Hi

I'm wiriting a custom validation javascript function

function nomeCheck(el){
  try{
  if ( el.val()=="a" ) {
    el.error.push("Error message here");
      return false;
  } else {
    return true;
  } 
 } catch(e){
    alert(e);
 }
}


and it returns the error

TypeError: el.error.push is not a function


What I'm doing wrong?
Thanks for your help
GreyHead 18 Dec, 2014
Hi rovell74,

The examples in the FAQs have el.errors.push

Bob
This topic is locked and no more replies can be posted.