2 Replies - 7064 Views - Last Post: 16 May 2009 - 11:27 PM Rate Topic: -----

#1 vinoth124  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-August 08

Need to load drop down box dynamically?

Post icon  Posted 06 May 2009 - 11:21 PM

Hi,

Actually I have two drop down list box in my web page. My aim is to load all the country names in the drop down box 1. This one I coded already with the select query and it is working fine.

But in the 2nd drop down list box I need to populate district value from the country table. Actually this drop down list box should populate all the value corresponding to the selected country value from the drop down1.

Note : The second drop down box should dynamically load the data from the database with reference to the drop down1 value. And also dropdown2 should load when user selects any data from drop down1.

Will you please give me some sample code for loading the second drop down box with reference to the first drop down value.

Please give me some suggestion to do this and let me know if you need for furthur more info.

Thanks in advance...

From,
Vinoth R

Is This A Good Question/Topic? 0
  • +

Replies To: Need to load drop down box dynamically?

#2 simplico  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 09-May 09

Re: Need to load drop down box dynamically?

Posted 09 May 2009 - 05:59 AM

Here is a start:

http://www.forta.com...l-1-AutoSuggest


And in the 2nd drop-down pass the form field name to use to retrieve district:

<cfselect name="drop2"
bind="cfc:(replace with CFC name).getDistrict({drop1})"
bindonload="true" />
Was This Post Helpful? 0
  • +
  • -

#3 cfkhoj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 16-May 09

Re: Need to load drop down box dynamically?

Posted 16 May 2009 - 11:27 PM

Hi,
Currently u may be given the country dropdown with the value to populate country values. Modify thecountry drop down value by adding a pipe symbol and the district value .For this , u need to select the district value along with the country value. Now, in the onchange function of dropdown, call a js function which splits the dropdown value of country and get the value after the pipe symbol. Then assign it to the district dropdown. U have the corresponding district now.
Plz try this...

View Postvinoth124, on 6 May, 2009 - 10:21 PM, said:

Hi,

Actually I have two drop down list box in my web page. My aim is to load all the country names in the drop down box 1. This one I coded already with the select query and it is working fine.

But in the 2nd drop down list box I need to populate district value from the country table. Actually this drop down list box should populate all the value corresponding to the selected country value from the drop down1.

Note : The second drop down box should dynamically load the data from the database with reference to the drop down1 value. And also dropdown2 should load when user selects any data from drop down1.

Will you please give me some sample code for loading the second drop down box with reference to the first drop down value.

Please give me some suggestion to do this and let me know if you need for furthur more info.

Thanks in advance...

From,
Vinoth R

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1