This form uses a script object to hold a function that runs the email verification code. I haven't yet figured out why the the value of EMAILADDRESS is undefined. I want the textfield1 to equal empty (not the word, but a blank space) if the email address doesn't match "@testdomain.com". Any ideas? Thanks.
You have a name conflict in your code. On line 3 of SOemailverification you define a variable EMAILADDRESS but I your code, I think, wants to access the form variable EMAILADDRESS (defined in the form properties).
I think you just need to delete line 3 of SOemailverification.
Also with a RegExp you can specifiy they are case insensitive, so you could use RegExp("^[A-Z0-9_\\-\\.]+\\@testdomain.com", "i"), that is with the "i" option in argument two, so you may not need the four RegExp?
I tried your ideas, but didn't get them to work. I finally realized I wasn't being specific enough for what the textfield1 should equal. I also changed the function variable name since it was the same as the global variable "EMAILADDRESS". Thank you for your help. The document works correctly now.