ecojohnson
06-23-2001, 12:57 AM
I am struggling to figure out how to pass values from an item into multiple text fields.
Specifically, what I am trying to do is set up my form so that when a user clicks on an item in one of the selectboxes, all the properties of the selected item will appear dynamically in the appropriate text boxes. If they select on another item, property values of the newly selected item will replace those old values (does this make sense?). I can easily do this with one text box. Where I run into problems is when I try to populate more than one text box with the select value's properites.
Any help is much appreciated.
<CFQUERY NAME="qNamePick">
SELECT ID, FName, LName, Address, City, Zip, Phone, Description
FROM NameTable
</CFQUERY>
<body>
<center>
<FORM ACTION="form2" METHOD="post" NAME="Dsp_Sel_Project" ID="Dsp_Sel_Project">
<TABLE>
<TD>
<SELECT NAME="ProjectNameList" ID="ProjectNameList" SIZE="5" style="width:225" onChange="parent.passText(this.form.ProjectNameList.options[this.form.ProjectNameList.selectedIndex].value);">
<OPTION VALUE="New">New...</OPTION>
<CFOUTPUT QUERY="qNamePick">
<OPTION VALUE="#qNamePick.name#">#qNamePick.name#</OPTION>
</CFOUTPUT>
</SELECT>
</TD>
<TD>
</TD>
<TD>
<SELECT NAME="ProjectAddressList" ID="ProjectAddressList" SIZE="5" style="width:225" onChange="parent.passText(this.form.ProjectAddressList.options[this.form.ProjectAddressList.selectedIndex].value);">
<OPTION VALUE="New">New...</OPTION>
<CFOUTPUT QUERY="qNamePick">
<OPTION VALUE="#qNamePick.Address#">#qNamePick.Address#</OPTION>
</CFOUTPUT>
</SELECT>
</TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD>FName</TD>
<TD><INPUT TYPE="text" NAME="test1" MAXLENGTH="50"></TD>
<TD>LName</TD>
<TD><INPUT TYPE="text" NAME="test2" MAXLENGTH="50"></TD>
</TR>
<TR>
<TD>Address</TD>
<TD><INPUT TYPE="text"></TD>
<TD>City</TD>
<TD><INPUT TYPE="text"></TD>
</TR>
<TR>
<TD>Zip</TD>
<TD><INPUT TYPE="text"></TD>
<TD>Phone</TD>
<TD><INPUT TYPE="text"></TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD>Description</TD>
<TD><INPUT TYPE="text" STYLE="width:388"></TD>
</TR>
</TABLE>
<INPUT TYPE="submit" VALUE="Continue">
<INPUT TYPE="submit" VALUE=" Save ">
<INPUT TYPE="Reset" Value=" Clear ">
</FORM>
Specifically, what I am trying to do is set up my form so that when a user clicks on an item in one of the selectboxes, all the properties of the selected item will appear dynamically in the appropriate text boxes. If they select on another item, property values of the newly selected item will replace those old values (does this make sense?). I can easily do this with one text box. Where I run into problems is when I try to populate more than one text box with the select value's properites.
Any help is much appreciated.
<CFQUERY NAME="qNamePick">
SELECT ID, FName, LName, Address, City, Zip, Phone, Description
FROM NameTable
</CFQUERY>
<body>
<center>
<FORM ACTION="form2" METHOD="post" NAME="Dsp_Sel_Project" ID="Dsp_Sel_Project">
<TABLE>
<TD>
<SELECT NAME="ProjectNameList" ID="ProjectNameList" SIZE="5" style="width:225" onChange="parent.passText(this.form.ProjectNameList.options[this.form.ProjectNameList.selectedIndex].value);">
<OPTION VALUE="New">New...</OPTION>
<CFOUTPUT QUERY="qNamePick">
<OPTION VALUE="#qNamePick.name#">#qNamePick.name#</OPTION>
</CFOUTPUT>
</SELECT>
</TD>
<TD>
</TD>
<TD>
<SELECT NAME="ProjectAddressList" ID="ProjectAddressList" SIZE="5" style="width:225" onChange="parent.passText(this.form.ProjectAddressList.options[this.form.ProjectAddressList.selectedIndex].value);">
<OPTION VALUE="New">New...</OPTION>
<CFOUTPUT QUERY="qNamePick">
<OPTION VALUE="#qNamePick.Address#">#qNamePick.Address#</OPTION>
</CFOUTPUT>
</SELECT>
</TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD>FName</TD>
<TD><INPUT TYPE="text" NAME="test1" MAXLENGTH="50"></TD>
<TD>LName</TD>
<TD><INPUT TYPE="text" NAME="test2" MAXLENGTH="50"></TD>
</TR>
<TR>
<TD>Address</TD>
<TD><INPUT TYPE="text"></TD>
<TD>City</TD>
<TD><INPUT TYPE="text"></TD>
</TR>
<TR>
<TD>Zip</TD>
<TD><INPUT TYPE="text"></TD>
<TD>Phone</TD>
<TD><INPUT TYPE="text"></TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD>Description</TD>
<TD><INPUT TYPE="text" STYLE="width:388"></TD>
</TR>
</TABLE>
<INPUT TYPE="submit" VALUE="Continue">
<INPUT TYPE="submit" VALUE=" Save ">
<INPUT TYPE="Reset" Value=" Clear ">
</FORM>



