F
Fred K.
Hi,
I have form text fields that have the attribute readonly. I wish to
use a javascript (invoked by a button on my page) to erase the values
and set
the readonly attribute to false. How do I do this?
Here's what I have that is not working with respect to setting
readonly to false:
function nsfields ( bDefaults ) {
if ( bDefaults == "Yes" ) {
// insert the default values in the fields
document.form1.ns1_hostname.value = 'foo.foobar.com';
document.form1.ns1_hostname.readonly = 'readonly';
} else {
// Blank the fields
document.form1.ns1_hostname.value = '';
document.form1.ns1_hostname.readonly = false;
}
}
I have form text fields that have the attribute readonly. I wish to
use a javascript (invoked by a button on my page) to erase the values
and set
the readonly attribute to false. How do I do this?
Here's what I have that is not working with respect to setting
readonly to false:
function nsfields ( bDefaults ) {
if ( bDefaults == "Yes" ) {
// insert the default values in the fields
document.form1.ns1_hostname.value = 'foo.foobar.com';
document.form1.ns1_hostname.readonly = 'readonly';
} else {
// Blank the fields
document.form1.ns1_hostname.value = '';
document.form1.ns1_hostname.readonly = false;
}
}