I am using the following code and the frm.fld.value gives an execution error: frm.fld has no properties. I know the variable "fld" gets passed correctly, but I can't put the value of fld in the frm.fld.value line. Is there anyway to make the fld value take the place of the variable name? Can anyone help?
Thanks,
castanz@yahoo.com
<script type="text/javascript">
<!--
function Check_Each_Entry(frm,fld)
{
// Check if the comment field has an entry. If it doesn't,
// show an error message, and set focus back to the field.
if (frm.fld.value != ""
{
return false;
}
alert('This field is a required field');
frm.fld.focus();
return true;
}
function checkEntries(frm)
{
// Make Array for all fields. -->
FieldList = new Array ("Date", "Time", "DateReport","status", "gender", "LastName", "FirstName", "SSN", "Rate", "Age", "Birthdate"
var Entry_Err = false
// Loop and find the first error. -->
for (i=0; i<=11; i++) {
fld = FieldList;
if (Entry_Err == false)
{
Entry_Err = Check_Each_Entry(frm,FieldList)
alert("Field: " +fld)
}
} //End For Statement -->
// If there is an error, return false. -->
if (Entry_Err == true)
//{
return false
//}
return true
} //End Function -->
//-->
</script>
Thanks,
castanz@yahoo.com
<script type="text/javascript">
<!--
function Check_Each_Entry(frm,fld)
{
// Check if the comment field has an entry. If it doesn't,
// show an error message, and set focus back to the field.
if (frm.fld.value != ""
{
return false;
}
alert('This field is a required field');
frm.fld.focus();
return true;
}
function checkEntries(frm)
{
// Make Array for all fields. -->
FieldList = new Array ("Date", "Time", "DateReport","status", "gender", "LastName", "FirstName", "SSN", "Rate", "Age", "Birthdate"
var Entry_Err = false
// Loop and find the first error. -->
for (i=0; i<=11; i++) {
fld = FieldList;
if (Entry_Err == false)
{
Entry_Err = Check_Each_Entry(frm,FieldList)
alert("Field: " +fld)
}
} //End For Statement -->
// If there is an error, return false. -->
if (Entry_Err == true)
//{
return false
//}
return true
} //End Function -->
//-->
</script>