S
sheetrum
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="(e-mail address removed)"
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>
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="(e-mail address removed)"
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>