Hi gurus, I have two radio buttons and under each radio button I have a few text input fields. I need to disable the text fields based on the radio option selection along with greying out the text area so as to let the user know that it is unavailble. Any help is appreciated. Thanks!!!
That could be done in the following manner: Assumptions: radio is the name of all the radio buttons for(var i=0; i<document.formName.radio.length; i++) { if(document.formName.radio[i].checked="1" && document.formName.radio[i].value="firstRadioButton") { document.formName.textBoxName.disabled="true"; } } Hope that helps.
Thanks. But I found a solution to it using <div> tags and onClick. The only problem I am having now is form validation on the input text fields between the <div>. Is there a way around it?
It's hard to say what's wrong without seeing any code, however most of the time you're having trouble reaching an element inside a div, it's the way you're calling through the DOM. Try using document.all['elementname'] for ie and document.layers['elementname'] and see if that gets you a reference.