V. T.
asked on
Use an Ajax fuction to change a Case of a CFswitch expression by clicking on a submit button
Good Morning Dear Expert,
I'm actually using Cfswitch expression to play several module on the same page with a page's "refreshment" when i submit the form.. i would like to use Coldfusion and Ajax for a different experience.. Is it possible on a input or submit Click, to call an Ajax function on the same page and in this function, change the variable of the CFcase expression to play a different mudule ?
Any response will be helpful..
I'm actually using Cfswitch expression to play several module on the same page with a page's "refreshment" when i submit the form.. i would like to use Coldfusion and Ajax for a different experience.. Is it possible on a input or submit Click, to call an Ajax function on the same page and in this function, change the variable of the CFcase expression to play a different mudule ?
Any response will be helpful..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A helpful alternative !
Thank you _agx_.
Thank you _agx_.
You're welcome. Glad it helped!
No. Javascript code executes long after the CFML code is finished, so it can't change any CF variables. In order to modify any variables in the current .cfm script, you must resubmit the form.
What you can do with ajax, is submit an HTTP request which returns HTML. Then use the HTML content to populate an element on the current page using javascript.