"Grey Out" boxes on an ASP form if radio button set to "NO"
Posted on 2006-06-28
I am trying to create a web version of a request form currently in Excel. It has a huge number of input boxes (around 90!!), some of which do not need to be filled in if the answer to certain questions is 'no'. I have been asked to grey out the relevant text fields where 'no' has been selected, to help stop users putting text in boxes that don't need it. I have no idea how to code this! Could somebody please give me some example code to:
- show how I would grey out text boxes in a form dependant on the results of another box?
- I will also need the SUB or FUNCTION that does the actual change.
- Lastly, all of my YES/NO options are drop down's using <SELECT>. If radio buttons are a better option (I don't know how to code those!) could you change the code below to show me how I should use them? If the SELECT options below are ok, then ignore this part of the question.
<SELECT id=lbNewstat name=lbNewstat>
<input type=hidden name=txtNewstat id=txtNewstat value="YES">
frmAdhocInsert.txtNewstat.value = frmAdhocInsert.lbNewstat(frmAdhocInsert.lbNewstat.selectedIndex).value