Dynamic check boxes

A place for users and developers of the Xataface to discuss and receive support.

Dynamic check boxes

Postby cantlep » Thu Mar 25, 2010 4:54 am

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
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Dynamic check boxes

Postby shannah » Thu Mar 25, 2010 7:54 am

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.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Dynamic check boxes

Postby cantlep » Thu May 13, 2010 10:12 am

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
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved