Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Mario Giannone #1
Javascript variables
How can I pass a javascript variable to coldfusion before submitting a form ?
Basically, I need to know the value of a drop down box selection, and based on
that value, when the user clicks submit, I launch a one of 2 possible pages.
Mario Giannone Guest
-
How to pass variables from JavaScript to Flex
Dear Flex comunity, Is there anyone who knows why isn't this code working? --FLEX 3-- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"... -
Javascript variables to cold fusion
I created variables in javascript and would like to have them available to me in cold fusion code. Does anyone know how I can do this? In the... -
Setting Global Variables from Javascript
Okay, here's the situation. I'm using an FSCommand to trigger a function in the javascript page that is hosting a flash movie I'm working on. Within... -
Setting variables in director from javascript
Due to the complexity of a project, I have decided to use Director over javascript. I'm apt in programming, but cannot seem to find a simple answer.... -
Passing variables from ASP to Javascript
I am using ASP to open a text file on the server and I want to pass variables to Javascript. Any suggestions? For example - I have a text file... -
CFGumby #2
Re: Javascript variables
One way would be to have the action page examine the option selected and call
the appropriate page, all CF. You can change the action page with JS with
document.FormName.action = vProgram;. You just have to condition that on the
option selected vOption =
document.FormName.DropDowns.options[document.FormName.DropDown.selectedIndex].va
lue;
CFGumby Guest
-
Mario Giannone #3
Re: Javascript variables
I'm not sure I know what you mean ? what if I make the values of the select
options the actual names of the pages I want to launch: How do I return that
value to the action attribute ? <form name='form1' method='post'
action='?????' target='_blank'> <select name='cmbRequestType'> <option
value='Page1.cfm'>Selection One</option> <option
value='Page2.cfm'>Selection Two</option> </select>
Mario Giannone Guest
-
CFGumby #4
Re: Javascript variables
Sorry, I wasn't that clear. Bur your example:
<form name="form1" method="post" action="?????" target="_blank"
onsubmit="changeaction();">
<select name="cmbRequestType">
<option value="Page1.cfm">Selection One</option>
<option value="Page2.cfm">Selection Two</option>
</select>
Then you would have the matching function
<script>
function changeaction() {
vSelectedPgm =
document.form1.cmbRequestType.options[document.form1.cmbRequestType.selectedInde
x].value;
document.form1.action = vSelectedPgm ;
{
</script>
CFGumby Guest
-
Mario Giannone #5
Re: Javascript variables
that worked great !
Thank you very much for your help !
Mario Giannone Guest



Reply With Quote

