See this sample snippet:
<html>
<head>
</head>
<body>
<form name="frm">
<input type="text" name="txt" value="Hello" />
<input type="button" onclick="this.form.txt.readOnly = true;" value="Disable text field" />
<input type="button" onclick="this.form.txt.readOnly = false;" value="Enable text field" />
<input type="button" value="My Button" name="btn" />
<input type="button" onclick="this.form.btn.disabled = true;" value="Disable button" />
<input type="button" onclick="this.form.btn.disabled = false;" value="Enable button" />
<select name="mySelect">
<option value="india">India</option>
<option value="america">America</option>
</select>
<input type="button" onclick="this.form.mySelect.disabled = true;" value="Disable drop down" />
<input type="button" onclick="this.form.mySelect.disabled = false;" value="Enable drop down" />
</form>
</body>
</html> ~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734