I've got two <CFQUERY>s - each of which populate select boxes. How can I default one from the other onchange? Can I use JavaScript somehow?
OnChange of the PR_TAX_CITY select box, I want to default the PR_TAX_COUNTY select box where GetTaxCities.county = GetTaxCounty.county....
...
Anyone? Anyone? Thanks for the time and help!
Holly
Code:
<CFQUERY NAME="GetTaxCities" DATASOURCE="#session.ORA_NAME#">
SELECT distinct(short_desc),city,dscr,county,state,val_addr_city,val_taxauth_city
FROM cis_city
WHERE coy='#G_COY#'
AND val_taxauth_city='Y'
</CFQUERY>
<CFQUERY NAME="GetTaxCounty" DATASOURCE="#session.ORA_NAME#">
SELECT distinct(short_desc),county,dscr,val_taxauth_cnty
FROM cis_county
WHERE coy='#G_COY#'
AND val_taxauth_cnty='Y'
</CFQUERY>
OnChange of the PR_TAX_CITY select box, I want to default the PR_TAX_COUNTY select box where GetTaxCities.county = GetTaxCounty.county....
...
Code:
<select name="PR_TAX_CITY">
<option value=""></option>
<CFOUTPUT QUERY = "getTaxCities">
<CFIF (trim(getTaxCities.dscr) eq trim(#PR_TAX_CITY#)) OR (trim(getTaxCities.city) eq trim(#PR_TAX_CITY#))>
<cfset tc_checked = "selected">
<CFELSE>
<cfset tc_checked = "">
</CFIF>
<option value = "#city#" #tc_checked#>#city# - #dscr#
</CFOUTPUT>
</select>
<select name="PR_TAX_COUNTY">
<option value=""></option>
<CFOUTPUT query = "getTaxCounty">
<CFIF trim(getTaxCounty.county) eq trim(#PR_TAX_COUNTY#)>
<CFSET tc_checked = "selected">
<CFELSE>
<CFSET tc_checked = "">
</CFIF>
<option value = "#county#" #tc_checked#>#county# - #dscr#
</CFOUTPUT>
</select>
Anyone? Anyone? Thanks for the time and help!
Holly