Solved

CF adding value to cfselect list

Posted on 2010-08-12
2
245 Views
Last Modified: 2012-06-21
Hello Experts.
Please help.
I have two forms
Parent.cfm   -   has cfselect LIST1 and cfinput BOX1
Child.cfm  -       popupwindow with cfinput BOX2
 I need to pass val from BOX2 to LIST1.
I have no problem to pass val from BOX2 to BOX1 using following

opener.AcceptingControl.value = val

But how can i add  val to LIST1 using the same approach?

Thank you in advance.
0
Comment
Question by:kqureshi321
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 250 total points
ID: 33423274
>> But how can i add  val to LIST1 using the same approach?

   Create a function on Parent.cfm that adds an option to LIST1.  Something like

           function yourFunctionName(theValue) {
                 var elem = document.getElementById('TheIDOfYourLIST1Control');
                 elem.options[elem.options.length] = new Option(theValue, theValue);
           }

   Then call it from your popup window.

        window.opener.yourFunctioName( valueToAdd );


   BTW: Since select lists have a "value" and "text", you can either use the same
   value  for both in your function _or_ supply two parameters .


0
 

Author Comment

by:kqureshi321
ID: 33424444
It worked! Perfect!
What was missing is this piece :   "elem.options[elem.options.length]".
Thanks a lot!
0

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question