RE: validate email in FrontPage form
From: Jim Buyens (news_at_interlacken.com)
Date: 03/05/05
- Next message: Buddy: "Re: Secure Forms?"
- Previous message: Ink: "How do I have an item add itself to a form when clicked in Frontp."
- In reply to: DayO: "validate email in FrontPage form"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 4 Mar 2005 16:53:02 -0800
If your two text boxes are named email1 and email2, as in:
<input type="text" name="email1" size="20">
<input type="text" name="email2" size="20">
then add this attribute to your <form> tag
<form onsubmit="chkEmail();" ... >
and add this script to the <head> section.
<script>
function chkEmail()
{
if (document.forms[0].email1.value == document.forms[0].email2.value)
{
document.forms[0].submit();
}
else
{
alert("E-mail addresses don't agree.");
}
}
</script>
However, this will only work if the page makes *no* use of the form field
validation built into FrontPage.
Basically, a form can only have one "onsubmit" event handler. That can be
the FrontPage event handler or a custom event handler (as described above)
but not both.
Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Windows SharePoint Services Inside Out
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
> How do I get FP 2002 forms to validate an email address? In other words, I
> want the user to type their email address in twice, in two seperate text
> boxes, and verify that they match. Thanks, DayO
- Next message: Buddy: "Re: Secure Forms?"
- Previous message: Ink: "How do I have an item add itself to a form when clicked in Frontp."
- In reply to: DayO: "validate email in FrontPage form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|