School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 309,245 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,660 people online right now. Registration is fast and FREE... Join Now!




Need to load drop down box dynamically?

 

Need to load drop down box dynamically?

vinoth124

6 May, 2009 - 10:21 PM
Post #1

New D.I.C Head
*

Joined: 21 Aug, 2008
Posts: 2

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

User is offlineProfile CardPM
+Quote Post


simplico

RE: Need To Load Drop Down Box Dynamically?

9 May, 2009 - 04:59 AM
Post #2

New D.I.C Head
*

Joined: 9 May, 2009
Posts: 4

Here is a start:

http://www.forta.com/blog/index.cfm/2007/5...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" />


User is offlineProfile CardPM
+Quote Post

cfkhoj

RE: Need To Load Drop Down Box Dynamically?

16 May, 2009 - 10:27 PM
Post #3

New D.I.C Head
*

Joined: 16 May, 2009
Posts: 1

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...

QUOTE(vinoth124 @ 6 May, 2009 - 10: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


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/26/09 09:35AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month