Validating EMAIL address

G

Guest

I have a form where users need to input various types of information,
including an EMAIL address. I'm constantly getting the forms submitted with
only half the information and no EMAIL address. How can I set up the
FrontPage form so that they get an error message if a field isn't filled in?
How can I set up the field for the EMAIL address to give an error message if
it isn't input or is not in a valid format? Ideally I would like the user to
get an error message explaining the fault and then allows them to continue
completing the form.

Thanks for any help.
 
J

Jon Spivey

Hi,
You can use FP validation - Right Click Form - Validation. This will make
the email field required but
 
G

Guest

Jon

Thanks for the feedback. However, I think your response got truncated.

Doug
====================
 
S

Steve Easton

I "think" he meant to add: but it won't guarantee that the email address is a valid "working"
address.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
T

Trevor L.

Here is a regex to check Email address (use in a script)

if (field.value.match
(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi))
return true

You can modify as you please if you know of other suffixes
 
M

Murray

I think it would be too dangerous to use such - the list of suffixes is just
enormous now - .biz, .xxx, .info, and then all the country codes....
 
A

Andrew Murray

in the form, right-click the email field, then go to "Validate" then set the
field as "required".
 
T

Trevor L.

Yes, I thought there may be lots more suffixes, but interestingly this
doesn't reject my Email address which ends in com.au, so perhaps the country
suffixes don't matter to this regex. Could that be the part: |(\..{2,2}) ?

I know very little about regex. It is an area I am looking forward to
learning about.
 
G

Guest

Andrew

This works great with drop-down boxes. I go to "validate" and then select
"data required". However, for text boxes (which I believe is my only choice
for an EMAIL address), thre does not seem to be a "data required" field.

Perhaps if I set the "data type" to "text", then under the "text format"
select "other" I could do something. Is there a way to specify the format as
'anything@anything'.

Alternatively, perhaps there is a better way to handle this for a text field.

Thanks for your help and best regards,
Doug
====================================
 
R

Ronx

Set a minimum length for the data field - check the required box and
type in a minimum of 6 - this allows an email address of (e-mail address removed)
Also consider setting the text format (with Data type set to text) to
include Letters, Digits, and Other (no whitespace), the "Other" being
..-_@ (dot hyphen underline and @) though this might exclude some valid
addresses.
--
Ron Symonds
Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.

Learn more about newsgroup questions here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;555375
 
T

Thomas A. Rowe

FYI: Form Field Validation, allow you so set what will be allowed, not the format of the data being
entered

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
M

Murray

Trevor:

Yes - that's checking for any 2 character suffix. But that's still not
enough, as I entered in my post. I think the other suggestions will give
you adequate checking....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top