Hi !
I've created a form where all the textfields are created dynamically based on the records available on the database. So the name of the field is also assigned dynamically (from jsp ). I want to disable the field based on a condition. So in each text field, I wrote a event function like this :
<INPUT TYPE="text" NAME="txt0<%= i %>0" VALUE="<%= rs_partdetail.getLong(13) %>" SIZE="8" MAXLENGTH="13" onFocus="fnDisable(this.form, this.name);">
And in the function, I try to disable that particulatr field calling this function by :
function fnDisable(frmname, fieldname)
{
if(multiFlag == "N"
{
alert(document.frmname.fieldname.value);
return false;
}
}
But I get error an error saying that
"document.frmname has no properties."
The catch is disable should work in both the browsers. What could be the problem. How to refer to the form field that has dynamic name.
Thanx
AJP
I've created a form where all the textfields are created dynamically based on the records available on the database. So the name of the field is also assigned dynamically (from jsp ). I want to disable the field based on a condition. So in each text field, I wrote a event function like this :
<INPUT TYPE="text" NAME="txt0<%= i %>0" VALUE="<%= rs_partdetail.getLong(13) %>" SIZE="8" MAXLENGTH="13" onFocus="fnDisable(this.form, this.name);">
And in the function, I try to disable that particulatr field calling this function by :
function fnDisable(frmname, fieldname)
{
if(multiFlag == "N"
{
alert(document.frmname.fieldname.value);
return false;
}
}
But I get error an error saying that
"document.frmname has no properties."
The catch is disable should work in both the browsers. What could be the problem. How to refer to the form field that has dynamic name.
Thanx
AJP