Google Chrome and missing form fields

Chrome , ColdFusion , Web Development Add comments

On a legacy application that I maintain, I have seen a rash of errors recently that are new. They are all in regards to form fields missing on a form action page. The things that make this one different is that:

  1. The fields in question are empty text fields, not unchecked radio buttons or checkboxes.
  2. The browser type of all these errors in Google Chrome

Now, while the fix is the same for all of these issues (CFPARAM the form fields), I was wondering if others have been seeing this with Chrome at all, and if there's any insights as to why Chrome seems to not want to pass along empty text fields, like every other browser out there does. I have not played with Chrome at all, and our applications do not officially support that browser at this time, so I can't spend much time at all investigating these errors in light of that. So I am hoping that some of y'all might have some information you would be willing to share?

8 responses to “Google Chrome and missing form fields”

  1. David Boyer Says:
    Taking a wild guess and knowing Google. It's probably to save that tiny amount of bandwidth it'd cost to pass along that empty field.
  2. David Boyer Says:
    Ah ha, it's optional for browsers to pass it or not. Looking at the HTML specs "If a control doesn't have a current value when the form is submitted, user agents are not required to treat it as a successful control."

    http://www.w3.org/TR/html401/interact/forms.html#successful-controls
  3. Rob Barthle Says:
    Thanks, that's some good info! Google is starting to creep into Microsoft territory in terms of making my life more difficult than it needs to be. I make it a habit of using CFPARAM on every form field I use, just to cover the bases. But like I said, this is legacy code and I have to have an assigned task in order to go work on it. I imagine I'll be piecemeal fixing this issue for the next few years...
  4. Peter Boughton Says:
    What version of Chrome?

    I get empty string passed with 4.0.249.78 (36714) for all these:
    <input type="text" name="one" value="" />
    <input type="text" name="two" />
    <input name="three" />
  5. John Gag Says:
    Chrome is becoming my personal browser of choice with Firefox being used for development. This kinda stuff is good to know. Thanks!
  6. Rob Barthle Says:
    The error I am researching was done on Chrome 3.0.195.38 running on Vista. I have 5 other similar errors where this occurred. What I have found is that this also includes select boxes in addition to text fields and textareas. In all these instances other form fields were passed that had values, but each of the fields in question had no value.

    The bottom line (to me) is that there is a one-size-fits-all solution. No matter the browser, keeping on top of the server side validation will catch any unexpected behavior, forcing users to use the system the way we want them to. CFPARAM is just one of those tools.

    What I find interesting and/or frustrating (depending on my mood) is how the browsers can choose to do things their own way. IE is just the easiest target in this regards, but they're seemingly not alone in this facet.
  7. David Boyer Says:
    I always tend to lean on the side of being paranoid and check for existence with StructKeyExists(url, 'field') or cfparam. That way you don't have to worry about someone messing with the form to try and make it error ;)
  8. Chris Says:
    I am running into this issue as well where I am using a form that allows a user to create a new form to display on the next page (multi-tier/part form). This "dynamic" form is then displayed with previous choices for them to fill out and submit.

    I just ran into a situation where I needed to have their initial selections persist to the final recording of the data. I can print and see the form value on the screen (in this case it is a list of values from a group of checkboxes ie: 1,3,4,6,etc) but the hidden form field is empty. I thought I was going nuts until I found this thread. Any ideas or work around really appreciated. I am using Chrome 4.0.249.89 (38071).

    Good thing is that the client will be using IE exclusively(argh...did I really say good thing).

    Any help or advice greatly appreciated. Rants are welcome too I suppose ;-)

Leave a Reply

Leave this field empty:

Powered by Mango Blog. Design and Icons by N.Design Studio