?
Solved

CF adding value to cfselect list

Posted on 2010-08-12
2
Medium Priority
?
247 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:Galina Besselyanova
[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 1000 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:Galina Besselyanova
ID: 33424444
It worked! Perfect!
What was missing is this piece :   "elem.options[elem.options.length]".
Thanks a lot!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 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