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

Q1552 How do I disable a form field?

irt.org | Knowledge Base | JavaScript | Form | Q1552 [ previous next ]

Q1552 How do I disable a form field?

Try:

<form name="myForm">
<input name="myField" type="text" disabled onFocus="if (this.disabled) this.blur()">
</form>

<script language="JavaScript"><!--
document.myForm.myField.disabled=true;
//--></script>

The disabled attibute in the field itself is for Internet Explorer and Netscape Navigator 6+, the script is for Netscape Navigator 3 and Netscape Navigator 4.

Feedback on 'Q1552 How do I disable a form field?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


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