jon-merchant
2/5/2018 - 4:41 AM

EmailValidation.js

function onSubmit() {
   //Type appropriate comment here, and begin script below
	var fieldName = 'email';
	var email = g_form.getValue(fieldName);
  var regEx = new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);

    
	
	if (!regEx.test(email)) {
		alert("The following fields contain invalid text:  Email");
		return false;
	}
}