Jacqui1811
Programmer
Can anyone see if I have the following code wrong.
Basically it is meant to pass the focus back to the form field passed in as parameter name.
It is passing the parameter through okay as I have run some debug code to see what value name has and it has the correct value.
If I hard code a form field name in it focuses okay but I need to focus on the form field passed in.
I really would appreciate the help guys.
<script language="javascript">
function updatePhasing(name,value)
{
if(isNaN(value))
{
alert("Invalid data format.\n\nOnly numbers are allowed.");
return ;
name.focus();
}
else
{
window.location='CTRPhasing.asp?name='+name+'&value='+value+'&update=yes&ctrScopeID=<%=ctrScopeID%>&year=<%=filterYearID%>' ;
}
}
</script>
Basically it is meant to pass the focus back to the form field passed in as parameter name.
It is passing the parameter through okay as I have run some debug code to see what value name has and it has the correct value.
If I hard code a form field name in it focuses okay but I need to focus on the form field passed in.
I really would appreciate the help guys.
<script language="javascript">
function updatePhasing(name,value)
{
if(isNaN(value))
{
alert("Invalid data format.\n\nOnly numbers are allowed.");
return ;
name.focus();
}
else
{
window.location='CTRPhasing.asp?name='+name+'&value='+value+'&update=yes&ctrScopeID=<%=ctrScopeID%>&year=<%=filterYearID%>' ;
}
}
</script>