Copy link to clipboard
Copied
Hi,
I`m just experimenting here..
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..
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Thanks for you advice Ian,
I managed to come up with a solution
Its similar to the javascript function you posted.
In the flash form I can add actionscript to the select box onChange attribute.
<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>
Now there is no need for a hidden field or a cfbutton.. 🙂
Copy link to clipboard
Copied
.
Copy link to clipboard
Copied
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#>