form validation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a form in FP 2003. The user has to enter their email address.
They then have to re-enter their email address. I would like an error
message to appear if the two email address do not match. Is there an easy
way to do this with FrontPage or do I have to get a java script?
Thanks
 
rkol said:
I created a form in FP 2003. The user has to enter their email address.
They then have to re-enter their email address. I would like an error
message to appear if the two email address do not match. Is there an easy
way to do this with FrontPage or do I have to get a java script?
Thanks

It wouldn't need much code

In your form, you could have this
<form name="form1" action="">
Email:<br/>
<input type="text" id="Email" value="Insert e-mail address" size="40"
/><br/>

Re-enter Email:<br/>
<input type="text" id="Email2" value="Insert e-mail address"
size="40" }"/><br/>

<input type="button" id="submit" value=" Send "
onmouseover="testform()" onclick="sendform()" />
<input type="reset" id="reset" value=" Clear "/>
</form>

Your js would read (amongst other things)
function testform()
with (document.form1)
{
if (Email != Email2)
{alert('Re-entered email is not the same. Please try again!')
Email.focus()
Email.select()
return false }
}
}
function sendform()
{
// Code to send form
}
 
However you can't just insert it and also use FP Form Field Validation at the same time.

--
==============================================
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.
==============================================
 
Back
Top