|
Q1222 How can I make a text box disable or readonly in Netscape Navigator?
irt.org | Knowledge Base | JavaScript | Form 3.6 | Q1222 [ previous next ]
Q1222 How can I make a text box disable or readonly in Netscape Navigator?
Try this:
<form name="myForm">
<input type="text" name="myTextField" value="" onFocus="if (this.disabled) { this.value = saveValue; setTimeout('document.myForm.myTextField.blur()',1); } else saveValue=this.value;">
<input type="checkbox" onClick="if (this.checked) { saveValue=this.form.myTextField.value; this.form.myTextField.disabled = true; } else this.form.myTextField.disabled = false;">
Disable
</form>
<script language="JavaScript"><!--
document.myForm.myTextField.disabled = false;
saveValue="";
//--></script>
|
Feedback on 'Q1222 How can I make a text box disable or readonly in Netscape Navigator?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.