Skip to main content
May 20, 2009
Question

How do I pass value to 'getURL' url variable

  • May 20, 2009
  • 1 reply
  • 1711 views

Howdy,

I`m trying to launch a popup from a flash form using MX 7

The popup works fine but I cant for the life of me work out how to pass 'theid' value to the url variable for the popup window.

I think somthing like this can be done with action script and maybe a cfc but I really dont know how.

You will notice I referenced 'theid' value directly, I know this will never work but just wanted to show what i was trying to acheive. If I were using a HTML form I could use some javascrip to get the element by id and append the value to the url. Is there away to do this in action script?

<cfform format = "flash">

<cfsavecontent variable="ticketpopup">
    getURL("javascript:window.open('supportdetails.cfm?id=#theid#' , 'TicketDetails', 'width=900,height=630, Scrollbars=1, resizable=0'); void(0);");  </cfsavecontent>

<cfselect name="selectbox" query="thequery" value="id" display="whatever"></select>

<cfinput type="hidden" name="theid" bind="{selectbox.selectItem.data}">

<cfinput type="button" name="mybutton" value="whatever" onClick="#ticketpopup#>

</cfform>

Any help, much appreciated 🙂

Thanks

This topic has been closed for replies.

1 reply

May 21, 2009

I answered my own question, heres is a solution if anyone is interested..

You can add the following actionscript to the onChange attribute of the select box. Its passes the value of the selected index to the URL and opens in a new window :-)

No there is no need for a hidden field or a button either

<cfform format ="flash">

<cfselect name="name" query="thequery" value="thevalue" display="whatever">

onChange="getUrl('supportdetails.cfm?ticketnumber=' + categorysubject.dataProvider[categorysubject.selectedIndex]['data'],'_blank');

</cfselect>

</cfform>