Hello,I am creating plugin
I have this piece of code below:
What i am trying to do is make sure the email address they enter is valid.
Just not sure how to stop the onOK if the email address is not valid.
Thanks
{
id : 'destEmail',
type : 'text',
label : 'Email form results to:',
'default' : '',
required : true,
accessKey : 'T',
commit : function( element )
{
var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
if (this.getValue().search(emailRegEx) == -1) {
alert("Please enter a valid email address.");
return false;
}
console.log(this.getValue());
}
}