Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.