Skip to main content
May 19, 2009
Question

CF7 binding to cfset variable

  • May 19, 2009
  • 1 reply
  • 710 views

Hello,

I am using MX 7 and just experimenting.

I am wondering if it is possible to bind data from a text box or a select box to a variable using CFSET in flash forms.

This is how I would imagine it to look but I know it doesnt work.....

<cfset myvar = {mytextbox.tex}>

or

<cfset myvar = {selectbox.selectedItem.data}>

Is it even possible in MX7 does anyone know?

Thanks

    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    May 19, 2009

    No it is not possible.  And once one clearly understands the seperation of the server and the client and that they never will meet, one would understand why it does not work.

    1) The server executes the cfml <cfset myvar = {mytextbox.text}> line.  An error is thrown because mytextbox.text does not exist on the client yet.

    2) If no error had been thrown the response would be returned to the web server.

    3) The web server would then return the response to the client.

    4) The client browser then executes the HTML and|or JavaScript afterwhich mytextbox.text will now exist.

    The only way data can get from a client to the server is with a request.  Using AJAX these requests can be done behind the behind the scenes, but they are still requests passing data as get or post variables.

    May 19, 2009

    Great, your explanation makes good sense.

    I have a better understanding of this now, thank you.