Im using the following code to popup a window that displays a list, clicking
on an item in the list will then close the popup window and populate an
INPUT field.  This works great and I am now trying to modify the code so I
can bring up a list of address's in the popup, each address would represent
a single link, once clicked it will populate multiple INPUT fields.  Im not
that familiar with Javascript and had this code basically given to me (thank
you Brett Suwyn!), so I need some guidance here.  Im including the working
un-butchered code below.



*** Main Form Page Start ***

<script language="JavaScript">
        function OpenSelectionWin(formfield,option) {

myoptionswindow=open('/scats/ryder/options.cfm?formname=ebstrack&field='+for
mfield+'&option='+option,'myname','resizable=yes,scrolling=yes,width=350,hei
ght=270');      }
</script>


<FORM ACTION="/blah.cfm" METHOD="POST" NAME="ebstrack">
<a href="javascript:OpenSelectionWin('po','po')">PO LIST</a>
<a href="javascript:OpenSelectionWin('po','posku')">PO SKU LIST</a>
<input type="text" name="po" value="" size="21">
</FORM>

*** Main Form Page End ***








*** Popup options.cfm Page Start ***
<script language="JavaScript">
        function SelectOption(sOptionText) {
        <cfoutput>opener.#URL.FormName#.#URL.Field#.value = sOptionText;</cfoutput>
                self.close();
        }
</script>



        <cfswitch expression="#URL.Option#">
                <cfcase value="po">
<CFQUERY NAME="getOptions" DATASOURCE="blah"
CACHEDWITHIN="#CreateTimeSpan(0,0,5,0)#">
SELECT po AS OptionText FROM po_header WHERE po IS NOT NULL GROUP BY po
ORDER BY po
</CFQUERY>
                </cfcase>

                <cfcase value="posku">
<CFQUERY NAME="getOptions" DATASOURCE="blah"
CACHEDWITHIN="#CreateTimeSpan(0,0,5,0)#">
SELECT posku AS OptionText FROM po_detail WHERE posku IS NOT NULL GROUP BY
posku ORDER BY posku
</CFQUERY>
                </cfcase>
        </cfswitch>


        <cfoutput query="getOptions">
                <a href="javascript:SelectOption(#OptionText#)">#OptionText#</a><br>
        </cfoutput>

*** Popup options.cfm Page End ***





I need to populate multiple INPUT now, something like this, I know this code
is close Im just not sure how to modify the options.cfm Javascript to pass
back multiple values, and everything Ive tried results in Javascript errors.


<FORM ACTION="/blah.cfm" METHOD="POST" NAME="ebstrack">
<a href="javascript:OpenSelectionWin('cust','address')">List Address</a>
<input type="text" name="name" value="" size="21"><br>
<input type="text" name="address" value="" size="21"><br>
<input type="text" name="city" value="" size="21"><br>
<input type="text" name="state" value="" size="21"><br>
<input type="text" name="zip" value="" size="21"><br>
</FORM>

Thanks! Adrian


















~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to