I have #getref.currentrow# as part of field name in the form.
<cfoutput query="getref">
<input type="text" name="first_name#getref.currentrow#" value="#first_name#" size="25" maxlength="75">
</cfoutput>
I would like to use javascript to check the form validation.
<cfset ttl = #getRef.recordcount#>
<script LANGUAGE="JavaScript">
function checkfields()
{
for (var i = 1; i <= <cfoutput>#Variables.ttl#</cfoutput>; i++)
{
if (document.reflist['first_name'+i].value == ""
{ alert ('Please enter Reference's first name');
return false;}
}
else return true;
}
</script>
doesn't seem to work. any ideas? Thanks
<cfoutput query="getref">
<input type="text" name="first_name#getref.currentrow#" value="#first_name#" size="25" maxlength="75">
</cfoutput>
I would like to use javascript to check the form validation.
<cfset ttl = #getRef.recordcount#>
<script LANGUAGE="JavaScript">
function checkfields()
{
for (var i = 1; i <= <cfoutput>#Variables.ttl#</cfoutput>; i++)
{
if (document.reflist['first_name'+i].value == ""
{ alert ('Please enter Reference's first name');
return false;}
}
else return true;
}
</script>
doesn't seem to work. any ideas? Thanks