Help with Form Validation???

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>
&nbsp;<input name="Name" size="20" style="color: #0000FF; font-size:
14pt" tabindex="1"><b>&nbsp;&nbsp;</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>
&nbsp;<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>
&nbsp;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">
&nbsp;<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>
 
T

Thomas A. Rowe

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)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
S

sheetrum

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
 
T

Thomas A. Rowe

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)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
S

sheetrum

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top