tomouse
Technical User
- Aug 30, 2010
- 50
Hi. I have an ASP page (with masterpage) in which users can add multiple Web User Controls (from ASCX file). These contain multiple controls including two radio buttons and a text field. I want to use javascript to disable the text field if the user clicks on one of the radio buttons.
Because there are potentially multiple sets of the text field and radio buttons on the page, I'm not sure how to reference the text field direction. I was thinking perhaps the way to do it would be to reference the text field relatively (if that's the word). I can pass the radio button object to my javascript function and am now looking for a way to say something like
Is this possible? Or is there a better way to approach this?
As you can see, I'm not big on javascript (though I do think it's great!). I've been searching for a while, but haven't found what I'm looking for. Any help much appreciated.
Because there are potentially multiple sets of the text field and radio buttons on the page, I'm not sure how to reference the text field direction. I was thinking perhaps the way to do it would be to reference the text field relatively (if that's the word). I can pass the radio button object to my javascript function and am now looking for a way to say something like
Code:
function DisableField(rb) {
var txtField = rb.parent.find('textfield');
txtField.disabled = True;
}
As you can see, I'm not big on javascript (though I do think it's great!). I've been searching for a while, but haven't found what I'm looking for. Any help much appreciated.