I want to select a name from a select option, and have related information show up in other boxes based on the name selected, on the same screen. I can do a second query on a second page to the get the data, but is there a way to get it on the first screen.
This code works to populate the boxes with static data when a name is selected, but is there a way to get the site and phone data related to the selected name from the query to populate the boxes?
<CFQUERY NAME="GETDATA" DATASOURCE="contacts">
SELECT lastname, (lastname+', '+firstname) AS NAME, site, phone
from hlphone2
Order by Lastname
</CFQUERY>
<script type="text/javascript">
function boxes(){
document.myform.boxsite.value = "site";
document.myform.boxphone.value = "phone";
}
</script>
<cfForm action="fil2.cfm" method="post" name = "myform" >
<cfinput type="text" name="boxsite"><br>
<cfinput type="text" name="boxphone"><br>
<cfselect name="options" onChange="boxes()">
<cfoutput query="getdata">
<option value="#getdata.NAME#">#Getdata.NAME#</option>
</cfoutput>
</cfselect>
</cfform>
Thanx for any help
This code works to populate the boxes with static data when a name is selected, but is there a way to get the site and phone data related to the selected name from the query to populate the boxes?
<CFQUERY NAME="GETDATA" DATASOURCE="contacts">
SELECT lastname, (lastname+', '+firstname) AS NAME, site, phone
from hlphone2
Order by Lastname
</CFQUERY>
<script type="text/javascript">
function boxes(){
document.myform.boxsite.value = "site";
document.myform.boxphone.value = "phone";
}
</script>
<cfForm action="fil2.cfm" method="post" name = "myform" >
<cfinput type="text" name="boxsite"><br>
<cfinput type="text" name="boxphone"><br>
<cfselect name="options" onChange="boxes()">
<cfoutput query="getdata">
<option value="#getdata.NAME#">#Getdata.NAME#</option>
</cfoutput>
</cfselect>
</cfform>
Thanx for any help