Copy link to clipboard
Copied
Hi
Not sure if this is validate or something else.
Want to be able to make sure that people paste in an email address in a text field and not just a persons name - how do I go about this.
I was going down the route of : If in the "Email Address" text box there is no "@" it will flag that the form has not been filled in correctly (been googling and cannot find anything to help) and subsequently cannot be submitted to another user via a separate submit button
See if something like this works for you (use as validate script):
var email = event.value;
var isValidEmail = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(email);
if(!isValidEmail && email !== "") {
app.alert("Please enter a valid email address.");
event.rc = false;}
Copy link to clipboard
Copied
See if something like this works for you (use as validate script):
var email = event.value;
var isValidEmail = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(email);
if(!isValidEmail && email !== "") {
app.alert("Please enter a valid email address.");
event.rc = false;}