This conversation has been locked due to inactivity. Please create a new post.
This conversation has been locked due to inactivity. Please create a new post.
I have an email field on a form and cannot seem to get the validation to work. Any entry seems to fail validation. This wouldn't be a huge problem, but I want the form to be able to be submitted via email and it will not work without a valid email.
any and all help would be greatly appreciated.
thank you
Solved! Go to Solution.
Views
Replies
Total Likes
Could you post the form you're having trouble with?
Views
Replies
Total Likes
Could you post the form you're having trouble with?
Views
Replies
Total Likes
attached is the form
Views
Replies
Total Likes
Try putting this script into validate event:
// Validate the email address.
var r = new RegExp(); // Create a new Regular Expression Object.
r.compile("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$","i");// Set the regular expression to look for
// an email address in general form.
var result = r.test(this.rawValue); // Test the rawValue of the current object to see
// if it fits the general form of an email address.
if (result == true) // If it fits the general form,
true; // all is well.
else // Otherwise,
false; // fail the validation.
That should take care of it.
please excuse my ignorance, but where do i put that code?
Views
Replies
Total Likes
No problem, here's how to do it:
1. Open the form with Designer
2. Press Ctrl+Shift+F5 to open the Script Editor
3. Click on the email field you need validated
4. In the Script Editor window, click on the drop down list on the top left.
It will say "Events with Scripts" by default. Select "validate" from the list that pops up.
5. Paste in the script I posted earlier
6. Make sure you have JavaScript selected in the Language drop down box on the
top right of the Script Editor
7. Preview the PDF and type in an invalid email address to make sure you get a
message popping up telling you the address is invalid.