Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2007-12-05 12:17:14

Grumlin3
Member
Registered: 2007-12-05
Posts: 0

Creating an Email Address Format to the text box Formatting

I am trying to create a form that requires a person Email Address, I was wondering what I have to do to the text box format in order for it to require an Email format i.e. poakes@regis.edu. If a student doesn't enter in the correct format it will let them know.


My Product Information:
Acrobat Pro 7 / Windows

Offline

 

#2 2007-12-06 08:51:58

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Creating an Email Address Format to the text box Formatting

Right click the Text field for the Email address entry. Click Properties from the drop down list. Click the Validate tab, find the Run Custom Validation script then click the edit button. Paste this code in the box and close.

var re = /^\S+@\S+\.\w{3}$/
var re2 = /^\w+([-_]\w+)*@\w+(\.\w{2,3})+$/

if (re.test(event.value) == false)    {
    app.alert("\"" + event.value + "\" is not a valid email address.")
    app.beep()
}

Note: Make this field and the following Name field required fields.

var re = /^[A-Z][a-z]+ [A-Z][a-z]+$/

if (re.test(event.value) == false)    {
    app.alert("That does not appear to be a valid name. I need a first and last name.")
    app.beep()
}

Offline

 

#3 2008-05-21 22:32:27

Spanners
Member
Registered: 2008-05-21
Posts: 1

Re: Creating an Email Address Format to the text box Formatting

The above code works, but only for emails with a format name@domain.com

It doesn't work for an email such as name.surname@domain.com.au
It beeps as if it is invalid.

What code do I need to add/change in order to get it to allow more formats of emails?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in