I get this error on line 36 which I marked below. The field names are fine and so is the logic I believe. I can't see the error. Any ideas?
<script type="text/javascript">
<!--
function validate()
{
x=document.myForm
column1=x.column.value
testValue=x.testValue.value
validDate=x.searchDate.value
groupedDate=x.groupedDate.value
groupedYear=x.groupedYear.value
fromDate=x.fromDate.value
toDate=x.toDate.Value
submitOK="True"
if (groupedDate != "NONE" && validDate != "" || groupedYear != "" && validDate != ""
{
alert("You cannot search for a specific date\nAND a grouped period at the same time."
submitOK="False"
}
if (toDate != "" && groupedDate != "" || fromDate != "" && groupedDate != "" || toDate != "" && groupedYear != "" || fromDate != "" && groupedYear != ""
{
alert("You cannot specify a date range\nAND a grouped period at the same time."
submitOK="False"
}
if (toDate != "" && validDate != "" || fromDate != "" && validDate != ""
{
alert("You cannot search for a specific date\nAND a date range at the same time."
submitOK="False"
}
if (fromDate.length != 0 && toDate = ""
{
alert("To use the date range, you must\nenter two proper dates."
submitOK="False"
}
if (fromDate.length = 0 && toDate.length != 0)
{
alert("To use the date range, you must\nenter two proper dates."
submitOK="False"
}
if (groupedDate = "NONE"
{
if (groupedYear.length != 0 && groupedYear.length < 4)
{
alert("When reporting by year, year field must be 4 characters.\n Ex. 2002 not 02"
submitOK="False"
}
}
if (column1 != "Identifier"
{
if (!testValue)
{
alert("Invalid Test Value for Search Criteria.\n\nField cannot be left empty."
submitOK="False"
}
}
if (fromDate.length > 0 && fromDate.length != 8)
{
alert("Invalid From Date Entry. Date must be in MM/DD/YY format."
submitOK="False"
}
if (toDate.length > 0 && toDate.length != 8)
{
alert("Invalid To Date Entry. Date must be in MM/DD/YY format."
submitOK="False"
}
if (validDate.length > 0)
{
if (validDate.length != 8)
{
alert("Invalid Date Entry. Date must be in MM/DD/YY format."
submitOK="False"
}
}
if (submitOK=="False"
{
return false
}
}
Thanks in advance.
Ryan
rmindorff@hotmail.com
<script type="text/javascript">
<!--
function validate()
{
x=document.myForm
column1=x.column.value
testValue=x.testValue.value
validDate=x.searchDate.value
groupedDate=x.groupedDate.value
groupedYear=x.groupedYear.value
fromDate=x.fromDate.value
toDate=x.toDate.Value
submitOK="True"
if (groupedDate != "NONE" && validDate != "" || groupedYear != "" && validDate != ""
{
alert("You cannot search for a specific date\nAND a grouped period at the same time."
submitOK="False"
}
if (toDate != "" && groupedDate != "" || fromDate != "" && groupedDate != "" || toDate != "" && groupedYear != "" || fromDate != "" && groupedYear != ""
{
alert("You cannot specify a date range\nAND a grouped period at the same time."
submitOK="False"
}
if (toDate != "" && validDate != "" || fromDate != "" && validDate != ""
{
alert("You cannot search for a specific date\nAND a date range at the same time."
submitOK="False"
}
if (fromDate.length != 0 && toDate = ""
{
alert("To use the date range, you must\nenter two proper dates."
submitOK="False"
}
if (fromDate.length = 0 && toDate.length != 0)
{
alert("To use the date range, you must\nenter two proper dates."
submitOK="False"
}
if (groupedDate = "NONE"
{
if (groupedYear.length != 0 && groupedYear.length < 4)
{
alert("When reporting by year, year field must be 4 characters.\n Ex. 2002 not 02"
submitOK="False"
}
}
if (column1 != "Identifier"
{
if (!testValue)
{
alert("Invalid Test Value for Search Criteria.\n\nField cannot be left empty."
submitOK="False"
}
}
if (fromDate.length > 0 && fromDate.length != 8)
{
alert("Invalid From Date Entry. Date must be in MM/DD/YY format."
submitOK="False"
}
if (toDate.length > 0 && toDate.length != 8)
{
alert("Invalid To Date Entry. Date must be in MM/DD/YY format."
submitOK="False"
}
if (validDate.length > 0)
{
if (validDate.length != 8)
{
alert("Invalid Date Entry. Date must be in MM/DD/YY format."
submitOK="False"
}
}
if (submitOK=="False"
{
return false
}
}
Thanks in advance.
Ryan
rmindorff@hotmail.com