hello,
i have a list of editable text fields that are displayed dynamically. I need to be able to "disable" each field using either a checkbox or a button.
I added a lock image next to each editable field, with an "onclick" property that calls a function to disable the proper field.
However, when I call the function, it disables the proper field, but then reloads the entire page, and the field that should have been disabled is now enabled again, which is the default state.
here is the asp code:
and here is the js function:
I didn't think that js functions automatically reloaded the page. Any idea on how to overcome this problem?
Thanks!!
</td>
i have a list of editable text fields that are displayed dynamically. I need to be able to "disable" each field using either a checkbox or a button.
I added a lock image next to each editable field, with an "onclick" property that calls a function to disable the proper field.
However, when I call the function, it disables the proper field, but then reloads the entire page, and the field that should have been disabled is now enabled again, which is the default state.
here is the asp code:
Code:
<td align="center">
<input type="text" name="txtInterestRate<%=i%>" size="10" value="<%=DisplayDecimal(strInterestRate,2)%>" >
<input type="image" name="LiborLock" onclick="LiborLock(<%=i%>)" src="file:///C:\Inetpub\[URL unfurl="true"]wwwroot\htdocs\images\lock.gif"></td>[/URL]
and here is the js function:
Code:
function LiborLock(i)
{
var PaymentRecord = eval('document.aform.txtInterestRate' + i);
if (eval('document.aform.txtInterestRate' + i).disabled==true)
{
PaymentRecord.disabled = false;
}
else
{
PaymentRecord.disabled = true;
}
}
I didn't think that js functions automatically reloaded the page. Any idea on how to overcome this problem?
Thanks!!
</td>