Access all controls within a Panel.

Hi Experts,

I am new to JQuery. Need to access all the controls within a Panel on client side.

I have an ASP Panel, in which radiobuttons will be created dynamically. I do not have names of those controls to specify in javascript, but I will know the pattern i.e. all names will be specified as rblEmployee_1, rblEmployee_2, etc.

I need to loop through all these controls and perform some action on controls in another panel on same page. Only if I can I loop through/access controls within a specific panel, my problem should be solved.

Thanks.
LVL 12
expertsoulAsked:
Who is Participating?
 
cdaugustinCommented:
hi,

how about if you add a specific css class name thats shared through all those controls and then you do a

$(".sharedClassNameHere").each(function () {
//do something for each matched elem
      });
0
 
prokvkCommented:
Here's the selector that should do the trick for you:



$('input[name^="rblEmployee_"]').click()

Open in new window

0
 
expertsoulAuthor Commented:
Sorry I couldn't really work with JQuery, due to lack of time and not having enough knowledge at the moment. I completed the task using JavaScript.
Thanks for the help. I will post some comments if able to test this out.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.