House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Question on form variables

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
fun and learning
09/07/2010 02:36 PM

Hi All - This might be a silly question, but I am confused with below scenario...I have some form variables set on a page, and clicking on submit button, I go to second page, where I am dumping these form variables...Some of the variable values show up as empty string, but when I see the form variables in the coldfusion debugging section, all the variable values are set. Am I missing something here?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
09/07/2010 02:50 PM

Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. You'd need to add a hidden form field on page one, and populate it's value from the FORM variable you're creating. Hi All - This might be a silly question, but I am confused with below scenario...I have some form variables set on a page, and clicking on submit button, I go to second page, where I am dumping these form variables...Some of the variable values show up as empty string, but when I see the form variables in the coldfusion debugging section, all the variable values are set. Am I missing something here?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
fun and learning
09/07/2010 02:57 PM

Yes, I am setting the hidden variables ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
09/07/2010 03:01 PM

So you're saying that when you inspect the FORM scope, by cfdumping it, on page two that the variables are there? But when you output them by themselves (FORM.varOne) they're empty? andy Yes, I am setting the hidden variables >Setting a variable into the FORM scope on page one, will not >automatically put those variables, or their values, into the FORM scope on page two. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
09/07/2010 03:13 PM

Are you cfparaming those variables at the top of page two? Are you cfincluding any code that might overwrite those variables? andy Yes, you are right. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
fun and learning
09/07/2010 03:52 PM

Thank you All..There was some other place where this variable was getting overwritten... ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matthew
09/07/2010 03:29 PM

My guess is that you've not set the method attribute in your form to "post", the default is "get" if not set. Sent from my iPhone On 7 Sep 2010, at 20:00, fun and learning <funandlrnng10@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alan Rother
09/07/2010 03:45 PM

Any chance you could just share your code with us so we can stop guessing about it? =] ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
09/07/2010 03:56 PM

If that were the case then why would the var names show up in the cfdump for the FORM scope? My guess is that you've not set the method attribute in your form to "post", the default is "get" if not set. Sent from my iPhone On 7 Sep 2010, at 20:00, fun and learning <funandlrnng10@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
fun and learning
09/07/2010 04:01 PM

it was happening as below: <cfif isDefined("URL.var1")>   <cfset Form.var1 = URL.var1> <cfelse>   <cfset Form.var1 = ""> </cfif> ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 08, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29