Populating an array or container from a drop-down list located in a pop-up window

Results 1 to 5 of 5

Thread: Populating an array or container from a drop-down list located in a pop-up window

  1. #1
    Bill Anthony Guest

    Default Populating an array or container from a drop-down list located in a pop-up window

    Fellow developers:<BR><BR>I am having some difficulty in the planning of an ASP action, whereby, you could call a pop-up window that would allow you to select multiple names from a drop-down list inside the pop-up and select (again from the pop-up) a button that would allow you to add each name to a list; whether it be an array or some other container located BACK ON THE MAIN PAGE. You could keep adding names from the pop-up window to populate your list back on the main page.<BR><BR>Where do I begin? I would have no clue how to direct or pass information back and forth between two active browser windows.<BR><BR>Your input is greatly appreciated.<BR><BR>Bill Anthony

  2. #2
    Bikash Panda Guest

    Default RE: Populating an array or container from a drop-down list located in a pop-up window

    Hi Bill,<BR>I can suggest you something. You can have the second window poping up and allowing the user to select multiple items in the dropdown list using embeded JavaScript codes to run at client. The parent window (the asp page) will be called by the pop up window in which you can pass the selected items as parameters. Use the parameters passed in the ASP page in the ARRAY.<BR><BR>Thanks<BR>Bikash

  3. #3
    Stephen Fisher Guest

    Default RE: Populating an array or container from a drop-down list located in a pop-up window

    Hope this is clear enough without explanation<BR><BR>On the parent page<BR>&#060;INPUT TYPE="TEXT" NAME="CustomerName" VALUE=""><BR>&#060;INPUT TYPE="BUTTON" NAME="DEST_Button" VALUE="Find Customer" ONCLICK="doMoveTo();"><BR><BR>&#060;SCRIPT LANGUAGE="JavaScript"><BR>function doMoveTo()<BR> {<BR> if ( document.BrowseForm.CustomerName.value == "" )<BR> {<BR> alert (&#039Please enter the initial of the customers first name&#039)<BR> }<BR> else<BR> {<BR> sSelect = "?where=" + document.BrowseForm.CustomerName.value<BR> var w = window.open("invoice_cust_select.asp" + sSelect ,"SelectWidget","width=740,height=400,resizable=ye s,menubar=no,scrollbars=yes,toolbar=yes")<BR> if ( w.focus )<BR> {<BR> w.focus();<BR> }<BR> }<BR> }<BR>&#060;/SCRIPT><BR><BR>On the child window<BR>&#060;A href="javascript:selectCustomer( &#039&#060;%=rsCust("CUST_NAME")&#037;&#062;&#0 39, &#039&#060;%=rsCust("STREET")&#037;&#062;&#039, &#039&#060;%=rsCust("CITY")&#037;&#062;&#039, &#039&#060;%=rsCust("POSTAL_CODE")&#037;&#062;&#03 9, &#039&#060;%=rsCust("PROVINCE")&#037;&#062;&#03 9 ) " > &#060;%=rsCust("CUST_NAME")&#037;&#062; &#060;/A><BR><BR>&#060;SCRIPT LANGUAGE="JavaScript"><BR>function selectCustomer( custName, street, city, postal, prov )<BR> {<BR> opener.document.BrowseForm.CustomerName.value = custName;<BR> opener.document.BrowseForm.Street.value = street;<BR> opener.document.BrowseForm.City.value = city;<BR> opener.document.BrowseForm.Postal.value = postal;<BR> opener.document.BrowseForm.Prov.value = prov;<BR> window.close();<BR> }<BR>&#060;/SCRIPT>

  4. #4
    Bill Anthony Guest

    Default RE: Populating an array or container from a drop-down list located in a pop-up window

    Stephen:<BR><BR>I certainly appreciate your response to my post. However, I am not clear on which page (parent or child) that "document.BrowseForm.CustomerName.value" refers to. My assumption is that it is referring to a form and field level value on the parent page. This being the case, does "opener.document.BrowseForm.CustomerName.value = custName;" in the child window script refer back to the parent page?<BR><BR>Would you mind providing some detailed elaboration? I would certainly appreciate your continued patience and help (or anyone else who&#039d like to provide additional comments).<BR><BR>Thanks again, Stephen for your time!<BR><BR>Bill Anthony


  5. #5
    Stephen Fisher Guest

    Default RE: Populating an array or container from a drop-down list located in a pop-up window

    "document.BrowseForm.CustomerName.value" is on the parent.<BR><BR>You need &#060;form action = "whatever.asp" name="BrowseForm"> on the parent as well. I did not notice that I reference this in the BrowseForm name. It should read forms[0] if you dont want to reference a specific form name.<BR><BR>opener.document.BrowseForm.CustomerNa me.value = custName;<BR>This does refer back to the parent. Again this could be <BR>opener.document.forms[0].CustomerName.value = custName; if your <BR>form isn&#039t called BrowseForm.<BR><BR>Hope this helps<BR><BR>Stephen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •