Connecting Tech Pros Worldwide Help | Site Map

quick search

Newbie
 
Join Date: Aug 2007
Posts: 1
#1: Aug 13 '07
in my project i had 2 dropdownlists one for the table names and the other for the field(coliumn names) to be displayed.the second dropdown list options should be
displayed regarding to the changes in the first drop down list.how can i do this?
eg:in dropdownlist 1 i had rhe tables as options eg;resumes,clients,..
when i select the clients in the firstdropdownlist ,then i should get all the fieldnamesin the second drop list can any one help me in this issue?
Expert
 
Join Date: May 2007
Posts: 213
#2: Jul 8 '08

re: quick search


You will probably want to use Ajax to fill list 2 based on list 1 selection. For instance, making a selection in list 1 will fire an onchange Ajax call. This will run a controller method to return the table fields and replace list 2 with that data. This page might be helpful. You can get all the field names in a table using Model.column_names, where Model is the name of your specific model.
Reply