Skip to content Skip to sidebar Skip to footer

Refering To Controls Through Javascript Function

I have a radiobutton column in a gridview, inside many nested asp tables. I want radios enable two buttons upon click. so I added this the following function an javascript but it c

Solution 1:

Change your JavaScript to this

<scriptlanguage="javascript"type="text/javascript">functionrdBtn_onClick() {

    document.getElementById("<%= btn_delete_list.ClientID %>").disabled = false;
    document.getElementById("<%= btn_showRes.ClientID %>").disabled = false;

    }
</script>

I'm guessing that the problem is to do with INamingContainer changing the ids of controls in the rendered HTML sent to the client.

Where are the buttons in your markup? What does the HTML look like when you View Source?

Solution 2:

can the problem be from the place of script tag? I put it under content tag.

No.

Where are the buttons? View the generated html source. Are the buttons there with the id you are looking for?

Also, it should be element.disabled = false, not element.enable = true

Post a Comment for "Refering To Controls Through Javascript Function"