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

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

Post by RGViIEJyb3 » Thu, 13 Oct 2005 01:22:02


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!
 
 
 

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

Post by Jon Spive » Thu, 13 Oct 2005 01:39:04

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;}".....

--
Cheers,
Jon
Microsoft MVP