PC Review Forums Newsgroups Microsoft Word Microsoft Frontpage Help with Form Validation???

Reply

Help with Form Validation???

 
Thread Tools Rate Thread
Old 19-02-2005, 03:26 AM   #1
sheetrum
Guest
 
Posts: n/a
Default Help with Form Validation???


I have been reading and reading about validating form fields in FP. When I
think I finally got it down, I fell flat on my face! Can anyone tell me
what is wrong with the following code. None of the Form Fields are being
validated!

I need to get this worked out so I can have the form working ASAP!

Thanks in advance.

<html>

<head>
<script>
function Validateticket_order()
{
var name = document.ticket_order.Name;
var telephone = document.ticket_order.Telephone;
var tickets = document.ticket_order.Tickets;
var email = document.ticket_order.Email;


if (name.value == "")
{
window.alert("Please enter your name.");
name.focus();
return false;
}

if (telephone.value == "")
{
window.alert("Please enter your telephone number.");
name.focus();
return false;
}

if (tickets.value == "")
{
window.alert("Please enter the number of tickets you wish to
purchase.");
name.focus();
return false;
}

if (email.value == "")
{
window.alert("Please enter a valid e-mail address.");
email.focus();
return false;
}
if (email.value.indexOf("@", 0) < 0)
{
window.alert("Please enter a valid e-mail address.");
email.focus();
return false;
}
if (email.value.indexOf(".", 0) < 0)
{
window.alert("Please enter a valid e-mail address.");
email.focus();
return false;
}

return true;
}
</script>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Form Only</title>
<meta name="Microsoft Border" content="l, default">
</head>

<body>

<form method="POST" action="--WEBBOT-SELF--" name="ticket_order">
<!--webbot bot="SaveResults" U-File="_private/jazz_tickets.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE"
S-Email-Format="HTML/PRE" S-Email-Address="webmaster@mydomain.org"
B-Email-Label-Fields="TRUE" B-Email-ReplyTo-From-Field="TRUE"
S-Email-ReplyTo="email" B-Email-Subject-From-Field="FALSE"
S-Email-Subject="Jazz Ticket Order" S-Date-Format="%B %d, %Y"
S-Time-Format="%I:%M %p" S-Builtin-Fields="REMOTE_NAME HTTP_USER_AGENT Date
Time" S-Form-Fields="Name Address Telephone Tickets Email "
U-Confirmation-Url="ticket_confirmation2.htm" -->
<p align="center">
<font face="Verdana" color="#0000FF"><b><br>
Name: </b>
 <input name="Name" size="20" style="color: #0000FF; font-size:
14pt" tabindex="1"><b>  </b></font><b><font face="Verdana"
color="#FF0000">*</font></b></p>
<p align="center">
<font face="Verdana" color="#0000FF"><b>Address: </b>
<input name="Address" size="20" style="color: #0000FF; font-size: 14pt"
tabindex="2"></font></p>
<p align="center">
<font face="Verdana" color="#0000FF"><b>Phone: </b>
 <input name="Telephone" size="20" style="color: #0000FF;
font-size: 14pt"> </font>
<font face="Verdana" color="#FF0000">*</font></p>
<p align="center"><font face="Verdana" color="#0000FF">
<b>
 Number of tickets @ $0.00 each: </b>
<input name="Tickets" size="2" tabindex="4" style="color: #0000FF;
font-size: 14pt"> </font>
<font face="Verdana" color="#FF0000">
*</font></p>
<p align="center"><b>
<font face="Verdana" color="#0000FF">E-mail address: </font></b>
<font face="Verdana" color="#0000FF">
 <input name="Email" size="20" style="color: #0000FF; font-size:
14pt" tabindex="5">
</font>
<font face="Verdana" color="#FF0000">
*</font><font face="Verdana" color="#0000FF"><br>
</font>
<font style="font-size: 8pt; text-decoration:underline" face="Verdana"
color="#0000FF">(strictly confidential) </font>
</p>
<p align="center"><u>
<font face="Verdana" color="#FF0000">
* Required</font></u></p>
<p align="center"><input type="submit" value="Submit" name="B1"><input
type="reset" value="Reset" name="B2"></p>
</form>

</body>

</html>


  Reply With Quote
Old 19-02-2005, 03:40 AM   #2
Thomas A. Rowe
Guest
 
Posts: n/a
Default Re: Help with Form Validation???

You are missing the OnSubmit tag with run the validation function in the opening form tag. create a
simple FP form with validation, then copy and modify the OnSubmit tag.

Also set the email format to plain text, as the FP Form Handler is not design to process HTML email.

FYI: You can not use a custom JavaScript Validation script and the FP Generated Validation script at
the same time. You have to remove the FP validation script and incorporate the validation in your
custom JavaScript Validation script.



--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

"sheetrum" <sheetrum@verizon.net> wrote in message news:eVCs$sjFFHA.3728@TK2MSFTNGP14.phx.gbl...
>I have been reading and reading about validating form fields in FP. When I think I finally got it
>down, I fell flat on my face! Can anyone tell me what is wrong with the following code. None of
>the Form Fields are being validated!
>
> I need to get this worked out so I can have the form working ASAP!
>
> Thanks in advance.
>
> <html>
>
> <head>
> <script>
> function Validateticket_order()
> {
> var name = document.ticket_order.Name;
> var telephone = document.ticket_order.Telephone;
> var tickets = document.ticket_order.Tickets;
> var email = document.ticket_order.Email;
>
>
> if (name.value == "")
> {
> window.alert("Please enter your name.");
> name.focus();
> return false;
> }
>
> if (telephone.value == "")
> {
> window.alert("Please enter your telephone number.");
> name.focus();
> return false;
> }
>
> if (tickets.value == "")
> {
> window.alert("Please enter the number of tickets you wish to purchase.");
> name.focus();
> return false;
> }
>
> if (email.value == "")
> {
> window.alert("Please enter a valid e-mail address.");
> email.focus();
> return false;
> }
> if (email.value.indexOf("@", 0) < 0)
> {
> window.alert("Please enter a valid e-mail address.");
> email.focus();
> return false;
> }
> if (email.value.indexOf(".", 0) < 0)
> {
> window.alert("Please enter a valid e-mail address.");
> email.focus();
> return false;
> }
>
> return true;
> }
> </script>
> <meta http-equiv="Content-Language" content="en-us">
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <title>Form Only</title>
> <meta name="Microsoft Border" content="l, default">
> </head>
>
> <body>
>
> <form method="POST" action="--WEBBOT-SELF--" name="ticket_order">
> <!--webbot bot="SaveResults" U-File="_private/jazz_tickets.csv" S-Format="TEXT/CSV"
> S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Email-Format="HTML/PRE"
> S-Email-Address="webmaster@mydomain.org" B-Email-Label-Fields="TRUE"
> B-Email-ReplyTo-From-Field="TRUE" S-Email-ReplyTo="email" B-Email-Subject-From-Field="FALSE"
> S-Email-Subject="Jazz Ticket Order" S-Date-Format="%B %d, %Y" S-Time-Format="%I:%M %p"
> S-Builtin-Fields="REMOTE_NAME HTTP_USER_AGENT Date Time" S-Form-Fields="Name Address Telephone
> Tickets Email " U-Confirmation-Url="ticket_confirmation2.htm" -->
> <p align="center">
> <font face="Verdana" color="#0000FF"><b><br>
> Name: </b>
>  <input name="Name" size="20" style="color: #0000FF; font-size: 14pt"
> tabindex="1"><b>  </b></font><b><font face="Verdana" color="#FF0000">*</font></b></p>
> <p align="center">
> <font face="Verdana" color="#0000FF"><b>Address: </b>
> <input name="Address" size="20" style="color: #0000FF; font-size: 14pt"
> tabindex="2"></font></p>
> <p align="center">
> <font face="Verdana" color="#0000FF"><b>Phone: </b>
>  <input name="Telephone" size="20" style="color: #0000FF; font-size: 14pt"> </font>
> <font face="Verdana" color="#FF0000">*</font></p>
> <p align="center"><font face="Verdana" color="#0000FF">
> <b>
>  Number of tickets @ $0.00 each: </b>
> <input name="Tickets" size="2" tabindex="4" style="color: #0000FF; font-size: 14pt"> </font>
> <font face="Verdana" color="#FF0000">
> *</font></p>
> <p align="center"><b>
> <font face="Verdana" color="#0000FF">E-mail address: </font></b>
> <font face="Verdana" color="#0000FF">
>  <input name="Email" size="20" style="color: #0000FF; font-size: 14pt" tabindex="5">
> </font>
> <font face="Verdana" color="#FF0000">
> *</font><font face="Verdana" color="#0000FF"><br>
> </font>
> <font style="font-size: 8pt; text-decoration:underline" face="Verdana" color="#0000FF">(strictly
> confidential) </font>
> </p>
> <p align="center"><u>
> <font face="Verdana" color="#FF0000">
> * Required</font></u></p>
> <p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset"
> name="B2"></p>
> </form>
>
> </body>
>
> </html>
>
>



  Reply With Quote
Old 19-02-2005, 03:57 AM   #3
sheetrum
Guest
 
Posts: n/a
Default Re: Help with Form Validation???

THANK YOU VERY MUCH!

Can you point me to the part of the code where I have FP validation
incorporated? I have been as careful as I can NOT to do this.

....BUT, the form now works fine


"Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:uyQZV0jFFHA.2824@tk2msftngp13.phx.gbl...
> You are missing the OnSubmit tag with run the validation function in the
> opening form tag. create a simple FP form with validation, then copy and
> modify the OnSubmit tag.
>
> Also set the email format to plain text, as the FP Form Handler is not
> design to process HTML email.
>
> FYI: You can not use a custom JavaScript Validation script and the FP
> Generated Validation script at the same time. You have to remove the FP
> validation script and incorporate the validation in your custom JavaScript
> Validation script.
>
>
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle, MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "sheetrum" <sheetrum@verizon.net> wrote in message
> news:eVCs$sjFFHA.3728@TK2MSFTNGP14.phx.gbl...
>>I have been reading and reading about validating form fields in FP. When
>>I think I finally got it down, I fell flat on my face! Can anyone tell me
>>what is wrong with the following code. None of the Form Fields are being
>>validated!
>>
>> I need to get this worked out so I can have the form working ASAP!
>>
>> Thanks in advance.
>>
>> <html>
>>
>> <head>
>> <script>
>> function Validateticket_order()
>> {
>> var name = document.ticket_order.Name;
>> var telephone = document.ticket_order.Telephone;
>> var tickets = document.ticket_order.Tickets;
>> var email = document.ticket_order.Email;
>>
>>
>> if (name.value == "")
>> {
>> window.alert("Please enter your name.");
>> name.focus();
>> return false;
>> }
>>
>> if (telephone.value == "")
>> {
>> window.alert("Please enter your telephone number.");
>> name.focus();
>> return false;
>> }
>>
>> if (tickets.value == "")
>> {
>> window.alert("Please enter the number of tickets you wish to
>> purchase.");
>> name.focus();
>> return false;
>> }
>>
>> if (email.value == "")
>> {
>> window.alert("Please enter a valid e-mail address.");
>> email.focus();
>> return false;
>> }
>> if (email.value.indexOf("@", 0) < 0)
>> {
>> window.alert("Please enter a valid e-mail address.");
>> email.focus();
>> return false;
>> }
>> if (email.value.indexOf(".", 0) < 0)
>> {
>> window.alert("Please enter a valid e-mail address.");
>> email.focus();
>> return false;
>> }
>>
>> return true;
>> }
>> </script>
>> <meta http-equiv="Content-Language" content="en-us">
>> <meta http-equiv="Content-Type" content="text/html;
>> charset=windows-1252">
>> <title>Form Only</title>
>> <meta name="Microsoft Border" content="l, default">
>> </head>
>>
>> <body>
>>
>> <form method="POST" action="--WEBBOT-SELF--" name="ticket_order">
>> <!--webbot bot="SaveResults" U-File="_private/jazz_tickets.csv"
>> S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE"
>> S-Email-Format="HTML/PRE" S-Email-Address="webmaster@mydomain.org"
>> B-Email-Label-Fields="TRUE" B-Email-ReplyTo-From-Field="TRUE"
>> S-Email-ReplyTo="email" B-Email-Subject-From-Field="FALSE"
>> S-Email-Subject="Jazz Ticket Order" S-Date-Format="%B %d, %Y"
>> S-Time-Format="%I:%M %p" S-Builtin-Fields="REMOTE_NAME HTTP_USER_AGENT
>> Date Time" S-Form-Fields="Name Address Telephone Tickets Email "
>> U-Confirmation-Url="ticket_confirmation2.htm" -->
>> <p align="center">
>> <font face="Verdana" color="#0000FF"><b><br>
>> Name: </b>
>>  <input name="Name" size="20" style="color: #0000FF; font-size:
>> 14pt" tabindex="1"><b>  </b></font><b><font face="Verdana"
>> color="#FF0000">*</font></b></p>
>> <p align="center">
>> <font face="Verdana" color="#0000FF"><b>Address: </b>
>> <input name="Address" size="20" style="color: #0000FF; font-size:
>> 14pt" tabindex="2"></font></p>
>> <p align="center">
>> <font face="Verdana" color="#0000FF"><b>Phone: </b>
>>  <input name="Telephone" size="20" style="color: #0000FF;
>> font-size: 14pt"> </font>
>> <font face="Verdana" color="#FF0000">*</font></p>
>> <p align="center"><font face="Verdana" color="#0000FF">
>> <b>
>>  Number of tickets @ $0.00 each: </b>
>> <input name="Tickets" size="2" tabindex="4" style="color: #0000FF;
>> font-size: 14pt"> </font>
>> <font face="Verdana" color="#FF0000">
>> *</font></p>
>> <p align="center"><b>
>> <font face="Verdana" color="#0000FF">E-mail address: </font></b>
>> <font face="Verdana" color="#0000FF">
>>  <input name="Email" size="20" style="color: #0000FF; font-size:
>> 14pt" tabindex="5">
>> </font>
>> <font face="Verdana" color="#FF0000">
>> *</font><font face="Verdana" color="#0000FF"><br>
>> </font>
>> <font style="font-size: 8pt; text-decoration:underline" face="Verdana"
>> color="#0000FF">(strictly confidential) </font>
>> </p>
>> <p align="center"><u>
>> <font face="Verdana" color="#FF0000">
>> * Required</font></u></p>
>> <p align="center"><input type="submit" value="Submit" name="B1"><input
>> type="reset" value="Reset" name="B2"></p>
>> </form>
>>
>> </body>
>>
>> </html>
>>
>>

>
>



  Reply With Quote
Old 19-02-2005, 04:10 AM   #4
Thomas A. Rowe
Guest
 
Posts: n/a
Default Re: Help with Form Validation???

I wrote that first, then I changed it to be a FYI, once I notice that you were not using any FP
validation.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

"sheetrum" <sheetrum@verizon.net> wrote in message news:%23k1N99jFFHA.2980@TK2MSFTNGP09.phx.gbl...
> THANK YOU VERY MUCH!
>
> Can you point me to the part of the code where I have FP validation incorporated? I have been as
> careful as I can NOT to do this.
>
> ...BUT, the form now works fine
>
>
> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:uyQZV0jFFHA.2824@tk2msftngp13.phx.gbl...
>> You are missing the OnSubmit tag with run the validation function in the opening form tag. create
>> a simple FP form with validation, then copy and modify the OnSubmit tag.
>>
>> Also set the email format to plain text, as the FP Form Handler is not design to process HTML
>> email.
>>
>> FYI: You can not use a custom JavaScript Validation script and the FP Generated Validation script
>> at the same time. You have to remove the FP validation script and incorporate the validation in
>> your custom JavaScript Validation script.
>>
>>
>>
>> --
>> ==============================================
>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>> WEBMASTER Resources(tm)
>> http://www.ycoln-resources.com
>> FrontPage Resources, WebCircle, MS KB Quick Links, etc.
>> ==============================================
>> To assist you in getting the best answers for FrontPage support see:
>> http://www.net-sites.com/sitebuilder/newsgroups.asp
>>
>> "sheetrum" <sheetrum@verizon.net> wrote in message news:eVCs$sjFFHA.3728@TK2MSFTNGP14.phx.gbl...
>>>I have been reading and reading about validating form fields in FP. When I think I finally got
>>>it down, I fell flat on my face! Can anyone tell me what is wrong with the following code. None
>>>of the Form Fields are being validated!
>>>
>>> I need to get this worked out so I can have the form working ASAP!
>>>
>>> Thanks in advance.
>>>
>>> <html>
>>>
>>> <head>
>>> <script>
>>> function Validateticket_order()
>>> {
>>> var name = document.ticket_order.Name;
>>> var telephone = document.ticket_order.Telephone;
>>> var tickets = document.ticket_order.Tickets;
>>> var email = document.ticket_order.Email;
>>>
>>>
>>> if (name.value == "")
>>> {
>>> window.alert("Please enter your name.");
>>> name.focus();
>>> return false;
>>> }
>>>
>>> if (telephone.value == "")
>>> {
>>> window.alert("Please enter your telephone number.");
>>> name.focus();
>>> return false;
>>> }
>>>
>>> if (tickets.value == "")
>>> {
>>> window.alert("Please enter the number of tickets you wish to purchase.");
>>> name.focus();
>>> return false;
>>> }
>>>
>>> if (email.value == "")
>>> {
>>> window.alert("Please enter a valid e-mail address.");
>>> email.focus();
>>> return false;
>>> }
>>> if (email.value.indexOf("@", 0) < 0)
>>> {
>>> window.alert("Please enter a valid e-mail address.");
>>> email.focus();
>>> return false;
>>> }
>>> if (email.value.indexOf(".", 0) < 0)
>>> {
>>> window.alert("Please enter a valid e-mail address.");
>>> email.focus();
>>> return false;
>>> }
>>>
>>> return true;
>>> }
>>> </script>
>>> <meta http-equiv="Content-Language" content="en-us">
>>> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
>>> <title>Form Only</title>
>>> <meta name="Microsoft Border" content="l, default">
>>> </head>
>>>
>>> <body>
>>>
>>> <form method="POST" action="--WEBBOT-SELF--" name="ticket_order">
>>> <!--webbot bot="SaveResults" U-File="_private/jazz_tickets.csv" S-Format="TEXT/CSV"
>>> S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Email-Format="HTML/PRE"
>>> S-Email-Address="webmaster@mydomain.org" B-Email-Label-Fields="TRUE"
>>> B-Email-ReplyTo-From-Field="TRUE" S-Email-ReplyTo="email" B-Email-Subject-From-Field="FALSE"
>>> S-Email-Subject="Jazz Ticket Order" S-Date-Format="%B %d, %Y" S-Time-Format="%I:%M %p"
>>> S-Builtin-Fields="REMOTE_NAME HTTP_USER_AGENT Date Time" S-Form-Fields="Name Address Telephone
>>> Tickets Email " U-Confirmation-Url="ticket_confirmation2.htm" -->
>>> <p align="center">
>>> <font face="Verdana" color="#0000FF"><b><br>
>>> Name: </b>
>>>  <input name="Name" size="20" style="color: #0000FF; font-size: 14pt"
>>> tabindex="1"><b>  </b></font><b><font face="Verdana" color="#FF0000">*</font></b></p>
>>> <p align="center">
>>> <font face="Verdana" color="#0000FF"><b>Address: </b>
>>> <input name="Address" size="20" style="color: #0000FF; font-size: 14pt"
>>> tabindex="2"></font></p>
>>> <p align="center">
>>> <font face="Verdana" color="#0000FF"><b>Phone: </b>
>>>  <input name="Telephone" size="20" style="color: #0000FF; font-size: 14pt"> </font>
>>> <font face="Verdana" color="#FF0000">*</font></p>
>>> <p align="center"><font face="Verdana" color="#0000FF">
>>> <b>
>>>  Number of tickets @ $0.00 each: </b>
>>> <input name="Tickets" size="2" tabindex="4" style="color: #0000FF; font-size: 14pt"> </font>
>>> <font face="Verdana" color="#FF0000">
>>> *</font></p>
>>> <p align="center"><b>
>>> <font face="Verdana" color="#0000FF">E-mail address: </font></b>
>>> <font face="Verdana" color="#0000FF">
>>>  <input name="Email" size="20" style="color: #0000FF; font-size: 14pt" tabindex="5">
>>> </font>
>>> <font face="Verdana" color="#FF0000">
>>> *</font><font face="Verdana" color="#0000FF"><br>
>>> </font>
>>> <font style="font-size: 8pt; text-decoration:underline" face="Verdana" color="#0000FF">(strictly
>>> confidential) </font>
>>> </p>
>>> <p align="center"><u>
>>> <font face="Verdana" color="#FF0000">
>>> * Required</font></u></p>
>>> <p align="center"><input type="submit" value="Submit" name="B1"><input type="reset"
>>> value="Reset" name="B2"></p>
>>> </form>
>>>
>>> </body>
>>>
>>> </html>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 19-02-2005, 04:46 AM   #5
sheetrum
Guest
 
Posts: n/a
Default Re: Help with Form Validation???

Yes, I noticed you can't use both validation methods while reading another
message.



"Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:u73xWFkFFHA.4052@TK2MSFTNGP14.phx.gbl...
>I wrote that first, then I changed it to be a FYI, once I notice that you
>were not using any FP validation.
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle, MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "sheetrum" <sheetrum@verizon.net> wrote in message
> news:%23k1N99jFFHA.2980@TK2MSFTNGP09.phx.gbl...
>> THANK YOU VERY MUCH!
>>
>> Can you point me to the part of the code where I have FP validation
>> incorporated? I have been as careful as I can NOT to do this.
>>
>> ...BUT, the form now works fine
>>
>>
>> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
>> news:uyQZV0jFFHA.2824@tk2msftngp13.phx.gbl...
>>> You are missing the OnSubmit tag with run the validation function in the
>>> opening form tag. create a simple FP form with validation, then copy and
>>> modify the OnSubmit tag.
>>>
>>> Also set the email format to plain text, as the FP Form Handler is not
>>> design to process HTML email.
>>>
>>> FYI: You can not use a custom JavaScript Validation script and the FP
>>> Generated Validation script at the same time. You have to remove the FP
>>> validation script and incorporate the validation in your custom
>>> JavaScript Validation script.
>>>
>>>
>>>
>>> --
>>> ==============================================
>>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>>> WEBMASTER Resources(tm)
>>> http://www.ycoln-resources.com
>>> FrontPage Resources, WebCircle, MS KB Quick Links, etc.
>>> ==============================================
>>> To assist you in getting the best answers for FrontPage support see:
>>> http://www.net-sites.com/sitebuilder/newsgroups.asp
>>>
>>> "sheetrum" <sheetrum@verizon.net> wrote in message
>>> news:eVCs$sjFFHA.3728@TK2MSFTNGP14.phx.gbl...
>>>>I have been reading and reading about validating form fields in FP.
>>>>When I think I finally got it down, I fell flat on my face! Can anyone
>>>>tell me what is wrong with the following code. None of the Form Fields
>>>>are being validated!
>>>>
>>>> I need to get this worked out so I can have the form working ASAP!
>>>>
>>>> Thanks in advance.
>>>>
>>>> <html>
>>>>
>>>> <head>
>>>> <script>
>>>> function Validateticket_order()
>>>> {
>>>> var name = document.ticket_order.Name;
>>>> var telephone = document.ticket_order.Telephone;
>>>> var tickets = document.ticket_order.Tickets;
>>>> var email = document.ticket_order.Email;
>>>>
>>>>
>>>> if (name.value == "")
>>>> {
>>>> window.alert("Please enter your name.");
>>>> name.focus();
>>>> return false;
>>>> }
>>>>
>>>> if (telephone.value == "")
>>>> {
>>>> window.alert("Please enter your telephone number.");
>>>> name.focus();
>>>> return false;
>>>> }
>>>>
>>>> if (tickets.value == "")
>>>> {
>>>> window.alert("Please enter the number of tickets you wish to
>>>> purchase.");
>>>> name.focus();
>>>> return false;
>>>> }
>>>>
>>>> if (email.value == "")
>>>> {
>>>> window.alert("Please enter a valid e-mail address.");
>>>> email.focus();
>>>> return false;
>>>> }
>>>> if (email.value.indexOf("@", 0) < 0)
>>>> {
>>>> window.alert("Please enter a valid e-mail address.");
>>>> email.focus();
>>>> return false;
>>>> }
>>>> if (email.value.indexOf(".", 0) < 0)
>>>> {
>>>> window.alert("Please enter a valid e-mail address.");
>>>> email.focus();
>>>> return false;
>>>> }
>>>>
>>>> return true;
>>>> }
>>>> </script>
>>>> <meta http-equiv="Content-Language" content="en-us">
>>>> <meta http-equiv="Content-Type" content="text/html;
>>>> charset=windows-1252">
>>>> <title>Form Only</title>
>>>> <meta name="Microsoft Border" content="l, default">
>>>> </head>
>>>>
>>>> <body>
>>>>
>>>> <form method="POST" action="--WEBBOT-SELF--" name="ticket_order">
>>>> <!--webbot bot="SaveResults" U-File="_private/jazz_tickets.csv"
>>>> S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE"
>>>> S-Email-Format="HTML/PRE" S-Email-Address="webmaster@mydomain.org"
>>>> B-Email-Label-Fields="TRUE" B-Email-ReplyTo-From-Field="TRUE"
>>>> S-Email-ReplyTo="email" B-Email-Subject-From-Field="FALSE"
>>>> S-Email-Subject="Jazz Ticket Order" S-Date-Format="%B %d, %Y"
>>>> S-Time-Format="%I:%M %p" S-Builtin-Fields="REMOTE_NAME HTTP_USER_AGENT
>>>> Date Time" S-Form-Fields="Name Address Telephone Tickets Email "
>>>> U-Confirmation-Url="ticket_confirmation2.htm" -->
>>>> <p align="center">
>>>> <font face="Verdana" color="#0000FF"><b><br>
>>>> Name: </b>
>>>>  <input name="Name" size="20" style="color: #0000FF; font-size:
>>>> 14pt" tabindex="1"><b>  </b></font><b><font face="Verdana"
>>>> color="#FF0000">*</font></b></p>
>>>> <p align="center">
>>>> <font face="Verdana" color="#0000FF"><b>Address: </b>
>>>> <input name="Address" size="20" style="color: #0000FF; font-size:
>>>> 14pt" tabindex="2"></font></p>
>>>> <p align="center">
>>>> <font face="Verdana" color="#0000FF"><b>Phone: </b>
>>>>  <input name="Telephone" size="20" style="color: #0000FF;
>>>> font-size: 14pt"> </font>
>>>> <font face="Verdana" color="#FF0000">*</font></p>
>>>> <p align="center"><font face="Verdana" color="#0000FF">
>>>> <b>
>>>>  Number of tickets @ $0.00 each: </b>
>>>> <input name="Tickets" size="2" tabindex="4" style="color: #0000FF;
>>>> font-size: 14pt"> </font>
>>>> <font face="Verdana" color="#FF0000">
>>>> *</font></p>
>>>> <p align="center"><b>
>>>> <font face="Verdana" color="#0000FF">E-mail address: </font></b>
>>>> <font face="Verdana" color="#0000FF">
>>>>  <input name="Email" size="20" style="color: #0000FF;
>>>> font-size: 14pt" tabindex="5">
>>>> </font>
>>>> <font face="Verdana" color="#FF0000">
>>>> *</font><font face="Verdana" color="#0000FF"><br>
>>>> </font>
>>>> <font style="font-size: 8pt; text-decoration:underline" face="Verdana"
>>>> color="#0000FF">(strictly confidential) </font>
>>>> </p>
>>>> <p align="center"><u>
>>>> <font face="Verdana" color="#FF0000">
>>>> * Required</font></u></p>
>>>> <p align="center"><input type="submit" value="Submit" name="B1"><input
>>>> type="reset" value="Reset" name="B2"></p>
>>>> </form>
>>>>
>>>> </body>
>>>>
>>>> </html>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off