form disable element.tt

<script type="text/javascript">
function dis_en(frm, a) {
	var action = (a) ? true : false;
	var i      = 0;
	while(frm[i]) {
		if(frm[i].type == "text")
			frm[i].disabled = action;
		i++;

		// other tests could be
		// frm[i].name == "surname"
		// or frm[i].value="no" :P
	}
}
</script>

<h2>Disable/enable the text-inputs by clicking the checkbox</h2>
<form>
<p>
	<input type="text" value="created">
	<br><input type="text" value="by">
	<br><input type="text" value="jan henning ;)">
	<br>disable/enable inputs: <input type="checkbox" onclick="dis_en(this.form, this.checked)">
</p>
</form>