gaby22
asked on
I Need a procedure to dinamically populate 3 drop-down menus depending on the selection of the first drop-down menu
I have 3 drop-down menus in a form
Question1 has 3 options. Depending on the answer to question1, question2 will show 6 to 10 options. Depending on the answer to the question 2, the third one will show options that will be populated from a db table. Question 3 options MUST come from a table
Question1 has 3 options. Depending on the answer to question1, question2 will show 6 to 10 options. Depending on the answer to the question 2, the third one will show options that will be populated from a db table. Question 3 options MUST come from a table
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dan has set it up correctly. There's no way to populate the third select field without doing a page post. What you'll need to do is select ALL records in your query.
<cfquery datasource="db" name="opts">
SELECT id, value, field_name
FROM table
<cfquery>
<select name="edition" disabled="true">
<cfoutput query="db">
<option value="#opts.id#" filter="#opts.field_name#" >#opts.val ue#</optio n>
</cfoutput>
</select>
opts.fieldname is equal to your value for the second dropdown.
and your table should have the basic structure of
id value field_name
1 F150 pickup
2 F250 pickup
3 A627 A6
4 A643 A6
<cfquery datasource="db" name="opts">
SELECT id, value, field_name
FROM table
<cfquery>
<select name="edition" disabled="true">
<cfoutput query="db">
<option value="#opts.id#" filter="#opts.field_name#"
</cfoutput>
</select>
opts.fieldname is equal to your value for the second dropdown.
and your table should have the basic structure of
id value field_name
1 F150 pickup
2 F250 pickup
3 A627 A6
4 A643 A6
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<cfquery datasource="db" name=opts">
select * from table where field_name = '#question2_value#'
</cfquery>
<select>
<cfouput query= opts>
<option value="#opts.fieldname#">#
</cfoutput>
</select>
I don't know how to get the question2_value to run the query