Page 1 of 1

Dynamic check boxes

PostPosted: Thu Mar 25, 2010 4:54 am
by cantlep
Hi All,

Can anyone assist with the necessary code requried to dynamically generate checkboxes based on what has been selected from a previous drop down menu. Also, is there anyway to get those checkboxes to appear at the bottom of the "new Entry" page?

Basically, I have a list of companies. Each company has a number of "Sites". Within a "Contract" table, (New Entry), I'd like to be able to select the company name from a drop down list (This is already in place) and then dynamically generate which "Sites" appear based on that selection. Currently, the sites are being pulled from another table, which also works fine. However, when I eventually have (for example) 5000 Sites, I don't want them all to be listed everytime I want to create a new Contract entry. I only want Sites to be available for selection based on what has been selected in the previous drop down menu.

I guess some javascript magic or similar will be used?

Hope you can help.

Cheers

Paul

Re: Dynamic check boxes

PostPosted: Thu Mar 25, 2010 7:54 am
by shannah
Yes. You'll almost definitely want to do a little bit of javascript/ajax for this.

One way to go would be to create a custom action that only outputs checkboxes for a particular site.
Then you can use AJAX to load these checkboxes in javascript dynamically and place them into your form.

I don't have any sample code off hand right now for this.

Re: Dynamic check boxes

PostPosted: Thu May 13, 2010 10:12 am
by cantlep
Hi All,

I know it's been a while. I don't suppose anyonehas some scripty magic that can help make this work at all?

Cheers

Paul