Alice wrote:
Quote:
if (document.all[txtField_0].readonly=true)
{
document.all[txtField_1].readonly=true;
}
else
{
document.all[txtField_1].readonly=false;
} |
The main problem there is your use of = instead of ==, the former an
assignment, the latter a comparison.
The second is your use of .readonly rather than .readOnly (remember JS
is case sensitive).
Although I wouldn't use the document.all collection - preferring the
standards compliant w3c method of document.getElementById() - however as
you are using it for your example, I will do the same..
document.all[txtField_1].readOnly = document.all[txtField_1].readOnly;
Hope this helps.
Ric.
A simple change of if (element.readOnly == true)_