Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Get Id of the control which is in the WebGroupBox using javascript
posted

 Hello Sir

I m using IE 7 browser,ASP.NET 2005,Infragistic  .NET 2007 VOL 3 CLR 2.0

I am using some controls like dropdownlist radiobuttonlist n labels within the WebGroupBox

Now i want the id's of controls like radiobuttonlist n dropdownlist using javascript

if i used code like this

  var radio = document.getElementsByName("<%=RadioButtonList1.ClientID%>");
    alert(radio.ID);

It show me message as undefined

and i want to use id of radiobutton for checking its length and selected item  using javascript

plz suggest me any solution

thanks

waiting for reply

Sonal  

Parents
No Data
Reply
  • 28464
    posted

    Hello Sonal,

    Your approach seems perfectly valid, the only thing that I think is problematic is that javascript is case sensitive, and id should be with low case in javascript, e.g.

    var radio = document.getElementsByName("<%=RadioButtonList1.ClientID%>");
        alert(radio.id);

Children
No Data