Solved

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

Posted on 2010-09-08
1
459 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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
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 …
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

14 Experts available now in Live!

Get 1:1 Help Now