Skip to main content
Inspiring
April 24, 2010
Question

CF8 has stopped populating form scope

  • April 24, 2010
  • 1 reply
  • 1464 views

G'day

For reasons that escape (and somewhat bamboozle ~) me, my CF8 server (just using the internal JWS for the web server) has stopped populating the form scope when a form is submitted.  Say I run this code:

<cfdump var="#form#">

<form action="<cfoutput>#CGI.script_name#</cfoutput>" method="post" name="frm1">
     <input type="text" name="txt1" value="" /><br />
     <input type="submit" name="btnSubmit1" value="Submit" />
</form>

When I submit the form, I simply get the dump outputting an empty struct.  I have verified that the HTTP request is being made properly: it's a POST, and the form field/value pairs are in there too.  Just nothing in the form scope.

I'm pretty sure there's no "stop the form scope from working" setting in CF, and I cannot find anything that might contribute to such behaviour.  And, also, I've not changed anything in the environment recently (although I would say that, obviously 😉

It's not some weirdness with an Application.cf(c|m) buggering things up, as I have a blocking Application.cfm in the same dir as the file.  So the first line of CF code that gets executed is the <cfdump>.  I have a 99.9% certainty it is nothing in the code causing this.  Plus the above is just my repro case.  The actual form I'm working on is in a completely different directory subtree, with no common ancestor to the one my test code is in, and - indeed - no commonality of code.

I have stop/started CF a couple of times.

There is nothing wrong with the form that I can see, and BlueDragon serves the form up (and has its form scope populated) no problems.

And when I was working on this code the day before y/day, it all worked fine on CF8 then.

Weird.

Any ideas of where to look to check what might be going on?

Cheers for any suggestions.

--

Adam

Oops.  Submitted before I had finished typing.  Updated so that the middle para makes sense.

    This topic has been closed for replies.

    1 reply

    Inspiring
    April 24, 2010

    Err... OK... weird.  It's started working again now.  And this didn't seem to require any specific input from me... it just started working again.  I just cracked on with my coding, thinking "well if I need to test anything, I'll use BlueDragon instead, and deal with this later", and inadvertantly refreshed the CF8 window rather than the BD one, and the form worked fine.  I went back to the test form I posted before, and simply reloaded it (resending the form data), and that worked too.  And that definitely had not had any changes made to it since I last saw it not work.

    "It's just one of those things", I guess.

    If anyone's had this happen before and knows why, I'd still be keen to know WTF was going on, but for my immediate purposes, this issue has self-corrected.

    Cheers.

    --

    Adam

    BKBK
    Community Expert
    Community Expert
    April 24, 2010

    There's one possibility I can think of. When you open the page for the first time, no form is submitted, and so the form scope dumped is the standard empty struct you expect. Now, it is quite likely that Coldfusion or the browser cached that version of the page, and reused it, instead of a fresh version.

    Inspiring
    April 25, 2010

    Good thinking, but in the case of the repro code I quoted, I had never browsed to it before, so there was nothing previously to have been cached. Similarly with the actual form I was working on, various debugging elements I had added in were processing and rendering just fine.

    --

    Adam