Skip to main content
November 6, 2012
Question

Dynamic Dropdown Box

  • November 6, 2012
  • 1 reply
  • 781 views

Hello, I’m very new to coldfusion and I’m trying to modify the existing form. Here is my requirement…

I have two dropdown boxes, based on the first drop down box, I like to fill the box two. 

Table Emp,

EmployeeNbr, EmployeeName

1,John

2,David

3,Vic

Table Dep,

EmployeeNbr, DepNbr,DepName

1, 1, Wine

1,2,HP

1,3,IBM

2,1,Phone

2,2,Mouse

3,1,Cable

I will be using the cfquery to populate the dropdown box1, If user select the employee nbr2 in drop down box1 I like to display depends records in dropdown box 2. Please guide to code this.

Thanks

This topic has been closed for replies.

1 reply

Inspiring
November 6, 2012

You're never too new to learn good habits.  What you are attempting is called "related selects" and the most effective way to accomplish it in ColdFusion these days is with binding.  A google search on "cfinput bind" will lead you to explanations and code samples.

November 6, 2012

Thanks, I will google it now.