Page 1 of 1

validate email

Posted: Fri Aug 14, 2015 9:32 pm
by Gurinder Mann

function validateEmail(email)
{
var re = /^([\w-]+(?:\.[\w-]+))@((?:[\w-]+\.)\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
return re.test(email);
}
var email = Apperyio('txt_mobiletextinput_4').val();

var errorMsg = "";

if ($.trim(email) === "")
{
errorMsg = errorMsg + "Email cannot be blank \n";
}

if (errorMsg === "")
{
restservice2.execute({});
}
else
{
alert("Please fix the following error: \n" + errorMsg);
}

---------------------------------------------------------------------------------------------------------

This is the code I am using I want to validate the email and display a error message if the email is not valid. how do I fix the code to do that??


validate email

Posted: Sat Aug 15, 2015 3:34 am
by Evgene Karachevtsev

Hello Gurinder,

Unfortunately custom js code is outside the scope of our support, you may look for it online and check errors in a browser console.