Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1222 How can I make a text box disable or readonly in Netscape Navigator?

You are here: irt.org | FAQ | JavaScript | Form | 3.6 | Q1222 [ previous next ]

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?'

©2018 Martin Webb