Skip to main content
May 19, 2009
Question

url variable in pop up window

  • May 19, 2009
  • 2 replies
  • 1017 views

Hi,

I`m just experimenting here..

  • In a flash form I got a hidden field that is bound to a select box
  • I got a button that calls some javascript to open a popup window
  • I want the url variable to hold the value of the hidden field when the button is pressed

     I have no idea if this can even be done in this way, I`m guessing not. Maybe there is a way to bind the hidden field to the url variable using javascript or action script? Any ideas would be cool..

    This topic has been closed for replies.

    2 replies

    May 19, 2009

    Here is a code example..

    <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#>

    ilssac
    Inspiring
    May 19, 2009

    HTML field value is accessible in JavaScript.

    The JavaScript code to open the popup windows uses this value in the URL of the window.

    Nothing tricky required here.

    <script>

    ...

       var jsVar = document.getElementById("IDofTextControl").value;

       window.open("www.url.com?urlVar=" + jsVar,....);

    ...

    </script>

    May 19, 2009

    Ahaa thats pretty cool, thanks.

    It would be great to do the same thing but with flash forms.

    Is javascript able to access the element id and value of a flash form field? It doesnt work when I try it so maybe there is another trick?

    Thaks

    ilssac
    Inspiring
    May 19, 2009

    Flash is different.  Flash isn't just markup, but an executing application.  There are ways to pull data from and push data into a flash object.  I'm affraid I can not provide such code though as I have never tried.  But I bet with some Google searching, code can be found.

    You might also gain some insight by examining the JavaScript and|or Actionscript generated for the webpages when the Flash form is delivered by ColdFusion.

    HTH

    Ian