Answer Question
Enabling the text fields corresponding to the clicked radio buttons
I need to create three radio buttons for the fields current address, permanent address and work address and when the radio button is clicked, the corresponding text fields such as 3 different address types should get activated.
If i clicked the first radio button, all the text fields are getting activated.Similarly for all the buttons, all the text fields are enabled.
Please help me to solve this issue in javascript
Thanks in advance.
Here is the code:
<br>function init(){
<br> //disable text fields
<br> var f = document.inputForm;
<br> f.CurrentAddress.disabled = true;
<br> f.PermanentAddress.disabled = true;
<br> f.WorkAddress.disabled = true;
<br>}
<br>
<br>function enableDisable(oFrm, enabledFldName, disabledFldNames){
<br> oFrm.elements[enabledFldName].disabled = false;
<br> if (disabledFldNames instanceof Array){ //multiple field names
<br> var len = disabledFldNames.length;
<br> for (var i=0; i<len; i++){
<br> oFrm.elements[disabledFldNames[i]].disabled = true;
<br> }
<br> }
<br> else{ //single field name
<br> oFrm.elements[disabledFldNames].disabled = true;
<br> }
<br>}
<br>
TEXT
Uploading file and scanning for virus...
Please Wait