These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Setting an arbitrary mask for an email address - is there a better way?

mobius55
Registered: Oct 14 2011
Posts: 9
Answered

Hi, all ~
 
I'm setting up a form that needs to minimize incorrect input as much as possible. Playing with the Arbitrary Masks, I see the Adobe example "OOOOO@XXX accepts the input vad12@3Up."
 
Fine. If every email address was five characters and every domain name was three, it would work great! So what to do in the real word, where there might be 30+ characters on either side of the @? Yeah, I've seen domain names that long!
 
Has anyone run into this issue, and can they shed some light? Is there a mask or validation that will require <1 characters, an @, and then another string of <1 characters? Scrollable field, obviously :-)
 
Thanx in advance for any thoughts. If I was a good scripter I'd probably have the answer in my head already, but I'm not, so I don't!
 
Cheers,
 
CR

Craig Rothfuss

My Product Information:
Acrobat Pro 10.0.2, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Accepted Answer
See if this helps: http://forums.adobe.com/message/3706835
mobius55
Registered: Oct 14 2011
Posts: 9
George:

The first script seems to work better for me than the later ones, for some reason. It catches every typo I've thrown at it yet.

Out of curiosity I Googled 'eMailValidate', but I'm not finding a reference to such a function. Is that something built into Acrobat or is it indeed Javascript? Just wondering where you called that function from.

Thanx again for your swift assistance.

Cheers,

CR

Craig Rothfuss

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
It's a built-in function, though undocumented. It's been around since at least version 7. If you're concerned about it not being available with older versions of Acrobat or Reader, you can copy the code into a custom document-level function that you create, but be sure to use a different function name. To get a code listing, just type "eMailValidate" in the interactive JavaScript console (Ctrl+J), and hit Ctrl+Enter.
mobius55
Registered: Oct 14 2011
Posts: 9
George, you rock! Kudos to you and your pals for making your deep knowledge available to the rest of us. You probably don't get thanked too often, judging from the posts I read - so here's a solid one from me.

I'm sure I'll be back for more sips at the well, most likely sooner rather than later :-)

CR

Craig Rothfuss