Not being much up on forms, I've probably just reinvented the wheel but, this does what I think you are asking with a minimum of messing around in the form itself yet, it is applicable to any form on the page with named elements. Put this in the head:
Code:
<script type="text/javascript">
function toggle(){
var i, j, args, els;
args=toggle.arguments
els=document.forms[args[0]]
i=0
while (typeof(els[i])!=='undefined'){
for (j = 1; j < args.length-1; j++)
if(els[i].name==args[j])
els[i].disabled=args[args.length-1]
i++
}
}
</script>
Then for your particular case, put this event:
Code:
<input type="checkbox" name="solution_needs" value="oppid" onclick="toggle('myForm', 'somevalue', 'totalrevenue', this.checked)">
This can be used with any checkbox, just follow the syntax:
Code:
onclick="toggle('formName', 'nameOfInput', 'nameOfInput', booleanValue)"
The formName is self explanatory. You can have as many nameOfInput's as you like and they do not have to be unique. The booleanValue may need some explanation. It is simply true or false. It can be expressed as 1 or 0 respectively, as well. In my example I used this.checked as, that is itself a boolean value that denotes the checked state of the checked box, true or false.
Bookmarks