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

Q1509 How can I disable and enable a form button?

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

Q1509 How can I disable and enable a form button?

Try the following in an HTML 4.x browser:

<form name="myForm">
<input type="button" name="myButton" onClick="if (!this.disabled) someFunction()">
<input type="submit" name="mySubmit" onClick="return (!this.disabled)">
</form>

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

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.