Solved

Passing the value of a select field from one cfwindow to another.

Posted on 2010-09-08
1
464 Views
Last Modified: 2012-05-10
I can't figure out how to pass the value of the selectedUserID into the cfwindow 'w2'
<cfparam name="selectedUserID" default="">



<html>

<head>



<script language="javascript">

    var mycallBack = function(){

        document.getElementById("callback").innerHTML = "<br><br><b>This is printed by the callback handler.</b>";

    } 



<!--- The error handler pops an alert with the error code and message. --->

    var myerrorhandler = function(errorCode,errorMessage){

        alert("[In Error Handler]" + "\n\n" + "Error Code: " + errorCode + "\n\n" + "Error Message: " + errorMessage);

    } 

</script>





</head>

<cfoutput>

<body>

<cfwindow name="w1" title="CF Window 1" initShow=true 

    x=10 y=10 width="400" height="200">

    User Administration.<br><br>

    <cfform name="myForm">

    <select name="SelectedUserID" 

    onChange="ColdFusion.navigate('test2.cfm?selectedUserID=(this.options[this.selectedIndex].value)','w2',

        mycallBack,myerrorhandler);">

    		<option value="">Please Select</option>

            <cfloop query="session.qry_getUsers">

    		<option value="#id#" <cfif selectedUserID eq id>selected</cfif>>#displayName#</option>

  			</cfloop>

	</select>

    </cfform>

   

</cfwindow>



<cfwindow name="w2" title="CF Window 2" initShow=true 

    x=450 y=10 width="600" height="600">

    This is a second cfwindow control. This is where I try and dump the variables and I'm not getting selectedUserID

</cfwindow>

</body>

</cfoutput>

</html>

Open in new window

0
Comment
Question by:traport
1 Comment
 

Accepted Solution

by:
traport earned 0 total points
ID: 33629738
Disregard I figured it out

<html>
<head>
<!--- The Callback handler puts text in the window.cfm callback div. --->
<script language="javascript">
    var mycallBack = function(){
        document.getElementById("callback").innerHTML = "<br><br><b>This is printed by the callback handler.</b>";
    }

<!--- The error handler pops an alert with the error code and message. --->
    var myerrorhandler = function(errorCode,errorMessage){
        alert("[In Error Handler]" + "\n\n" + "Error Code: " + errorCode + "\n\n" + "Error Message: " + errorMessage);
    }
</script>


</head>
<cfoutput>
<body>
<cfwindow name="w1" title="CF Window 1" initShow=true
    x=10 y=10 width="400" height="200">
    User Administration.<br><br>
    <cfform name="myForm">
    <select name="SelectedUserID" onChange="ColdFusion.navigate('test2.cfm','w2',
        'mycallBack', 'myerrorhandler', 'post', 'myForm');">
                <option value="">Please Select</option>
            <cfloop query="session.qry_getUsers">
                <option value="#id#" <cfif selectedUserID eq id>selected</cfif>>#displayName#</option>
                    </cfloop>
      </select>
    </cfform>
   
</cfwindow>

<cfwindow name="w2" title="CF Window 2" initShow=true
    x=450 y=10 width="600" height="600">
    This is a second cfwindow control.
</cfwindow>
</body>
</cfoutput>
</html>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
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 …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now