Link to home
Start Free TrialLog in
Avatar of rupurt
rupurt

asked on

hiding an asp .net radio button list item with javascript

i have a radio button list that i have created and i want to hide on of the items. i use the javascript function

function UpdateLists()
        {
            var radiobutton = document.getElementById('ctl00_maincontent_empnolist_0')
           
                radiobutton.style.display = "none"
        }

however this only hides the radio button. i also have a label which is attached to the button by default but asp .net doesnt seem to assign it an id? so there is no way for me to find the label to hide it.

is there another solution to my problem? thanks in advance
Avatar of robotman757
robotman757

Depending on where it is located you could put both the label and the button in the same <td> or <tr> tag and give that tag an id to hide or display. You could do it with a div tag as well
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oops I missed that .Net part!! I can't wait to get my copy of visual studio 2005...
If the radio buttons are all in a <tr> </tr>, then I can show you how to toggle that row without ID.