I am trying to populate a checkbox dynamically on web based on a selection from a dialog box. I searched the forum for examples and could not find anything. I would appreciate if someone can give me some ideas / samples showing how to implement this.
Ex: Dialog box field values populated with the keywords below using @DbLookup and contains only Test and Test1:
Keyword values:
Test~A
Test~B
Test~C
Test1~D
Test2~E
if the user chooses, Test, then the checkbox should be populated with A, B and C. If the user chooses, Test1, then the checkbox should be populated with D and E.
I have done this with dialog boxes without any problems using javascript. But, with checkbox, I am not able to do so. Any help is greatly appreciated.
The difference between a dialog box and a checkbox is that a dialog box is one single entity within the web page, and it contains the different values within this entity.
The checkbox consists of one or more separate entities, which is why you can’t change the number of choices with JS.
An alternative would be to wrap the checkboxes in a div, and replacing the entire checkbox with a new one, ie. write the complete HTML for the checkboxes to the document.getElementById(“enter div id here”).innerHTML.
Thank you for the response. You are right. I actually used the document.getElementById(“id name”).innerHTML to achieve the desired results. Once again, thank you for the response.