0
votes

I'm hoping I can get some quick help on this as I've been stuck here for the last week and can't move on until I get this figured out!

I have a dynamically created CheckBoxList in a DotNetNuke module I'm building. When DNN creates the page, it prepends the control name with the moduleID and moduleName. So, when I have "AddLicenseCheckBoxList" on the page, it becomes: "dnn_ctr949_addRateGroup_AddLicenseCheckBoxList" depending on what the ModuleID and page name is (in this instance it's 949 and addRateGroup respectively). Now, I don't know what the name of the page or moduleID will be when this module is finished, so I need to make sure I am accessing the control my whateer name DNN gives it, and getElementById or getElementByName do not work even when using '<%= %>'.

So what I need to do is use Javascript or some VB to retrieve the checked values of the dynamically created CheckBoxList so that I can run an update on the database with those selected values.

I've tried everything and even posted on Experts Exchange here: http://www.experts-exchange.com/viewQuestion.jsp?qid=25350327

if anyone is interested in points on that site. Please help if you can, I'm so stumped!

2

2 Answers

2
votes

To get the ID of the rendered HTML element, you can use the ClientID property. So, in your case, you can use document.getElementById('<%=AddLicenseCheckBoxList.ClientID%>') to access the checkbox list element.

0
votes

I found a post that does exactly what I want without using JavaScript....thanks!

http://www.syncfusion.com/FAQ/aspnet/WEB_c20c.aspx