how to create constraint so field 2 value matches field 1 value

G

Guest

Hi there.

I have a web site that has a form that captures namese and addresses of
people who are interested in information. Quite often people submit the form
with typos in their e-mail addresses. I would like to add a confirmation
field where the user has to retype the e-mail address for accuracy. The text
in the confirmation field should match the text in the e-mail field.

I don't see this option in the form field properties. Can the
"s-validation-constraint" in the webbot line be modified to make this work?

<!--webbot bot="Validation" s-display-name="mail validation"
s-data-type="String" b-allow-letters="TRUE" b-allow-digits="TRUE"
s-allow-other-chars="@.,-_" b-value-required="TRUE" i-minimum-length="1"
s-validation-constraint="Equal to" s-validation-value="Email" -->

Thanks much in advance!
 
J

Jon Spivey

Hi Deb,

Add your 2 email fields, let's call them email1 and email2 then flip over to
code view, find the submit button and make it look like this
<input type="submit"
onclick="if(this.form.email1.value!=this.form.email2.value){alert('Emails
don\'t match');return false;}".....
 
G

Guest

Hi Jon.

I tried your suggestion and it didn't work (changed the form name in the
example to the actual name of the form on the page). It still sent the mail
without complaint.

I'm using a custome image for my submit button, but removed the
customization when trying this - not sure how to make the image customization
work with the mod you sent. Did I Leave something out? I notice you have a
'...' at the end of your string, was there more I needed there?

Thanks much for the help!
Deb
 
J

Jon Spivey

Hi Deb,

You shouldn't use the name of the form - this.form refers to the form
whatever it's called, I assume that's all that's gone wrong but to be sure
can you post this page up on the web and I'll take a look for you.
 
G

Guest

Hi Jon,

Thanks for the help! The URL is http://imaniacs.org/join_us_test.htm

I noticed other validation statements using the string "theForm" instead of
"this.form" and tried that in your example. Didn't help. I also tried adding
a whitespace around the " !=" in the statement. Also didn't help.

Also, if it helps, I'm using FP 2003. The form was created with FP 2000 (I
believe).

Deb
 
T

Thomas A. Rowe

You can not just add custom JavaScript Validation to a Form when using FP Form Field Validation. You
have to copy the FP Form Field Validation script from View Source in the Browser, add your custom
JavaScript Code, then add the code back to your form, and remove all the FP JavaScript Form Field
Webbot tags.

--
==============================================
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.
==============================================
 
J

Jon Spivey

Deb,
I put the form up how it should be here
http://65.110.92.71/deb.htm

It will catch unmatching emails and your other validation will work - do a
view source to see how the submit button should look

--
Cheers,
Jon
Microsoft MVP
 

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