Hi Corey!
Can I copy the FP generated javascript to a .js file and somehow call it instead of the FP function?
Here is the FP generated code: (it seems to be chocking at the 70 value.
<script Language="JavaScript" Type="text/javascript"><!-
function FrontPage_Form1_Validator(
{
if (theForm.Name.value == "")
{
alert("Please enter a value for the \"Name\" field.");
theForm.Name.focus();
return (false);
}
if (theForm.Name.value.length
{
alert("Please enter at most 70 characters in the \"Name\" field.");
theForm.Name.focus();
return (false);
}
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXY
var checkStr = theForm.Name.value;
var allValid = true;
var validGroups = true;
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Please enter only letter and whitespace characters in the \"Name\" field.");
theForm.Name.focus();
return (false);
}
if (theForm.EmailAddress.valu
{
alert("Please enter a value for the \"EmailAddress\" field.");
theForm.EmailAddress.focus
return (false);
}
if (theForm.EmailAddress.valu
{
alert("Please enter at least 5 characters in the \"EmailAddress\" field.");
theForm.EmailAddress.focus
return (false);
}
if (theForm.EmailAddress.valu
{
alert("Please enter at most 35 characters in the \"EmailAddress\" field.");
theForm.EmailAddress.focus
return (false);
}
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXY
var checkStr = theForm.EmailAddress.value
var allValid = true;
var validGroups = true;
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Please enter only letter, digit, whitespace and \"@.\" characters in the \"EmailAddress\" field.");
theForm.EmailAddress.focus
return (false);
}
if (theForm.DaytimePhone.valu
{
alert("Please enter a value for the \"Daytime Phone\" field.");
theForm.DaytimePhone.focus
return (false);
}
if (theForm.DaytimePhone.valu
{
alert("Please enter at least 5 characters in the \"Daytime Phone\" field.");
theForm.DaytimePhone.focus
return (false);
}
if (theForm.DaytimePhone.valu
{
alert("Please enter at most 12 characters in the \"Daytime Phone\" field.");
theForm.DaytimePhone.focus
return (false);
}
var checkOK = "0123456789-()- \t\r\n\f";
var checkStr = theForm.DaytimePhone.value
var allValid = true;
var validGroups = true;
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Please enter only digit, whitespace and \"()-\" characters in the \"Daytime Phone\" field.");
theForm.DaytimePhone.focus
return (false);
}
return (true);
}
//--></script>
Main Topics
Browse All Topics





by: coreybryantPosted on 2004-09-09 at 08:11:48ID: 12017490
That part seems correct. Have you considered writing your own JS to verify the input fields?
-Corey