The CreatorCon Call for Content is officially open! Get started here.

regex is correct but some issue in the script

Community Alums
Not applicable

Hi,

I wrote the regex for validating the email ID, but the problem is coming with respect to the code. Kindly help.

 

function onSubmit() {

	var email_ID = g_form.getValue("email");
	
	
		var testEmail = /^([a-z0-9A-Z\_\.]*)@([a-z\.]*)$/;

		if (!testEmail.test(email_ID)) {
			g_form.addErrorMessage("invalid email");
			return false;
		}
		return true;

 

Regards

Suman P.

12 REPLIES 12

Community Alums
Not applicable

Hi @Amit Pandey ,

I copied your script and tried to use it and I get "Invalid email format" on the top.

Regards

Suman P.

What is your current email format?

Community Alums
Not applicable

Hi @Amit Pandey ,

is is from incident table. So, it is coming from caller - > email. Do you think email is the correct format?

Regards

Suman P.