PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Address city field "name" property

  1. A client is griping because when he starts typing his city into the city field his browser is not offering his previously typed cities. I did an experiment and the reason is that the browser doesn't recognize the filed. The reason is the city field code looks like this:

    <input type="text" tabindex="7" value="" id="input_3_2_5" name="input_2.5">

    I did an experiment and set the "name" property to "city" with firebug and after that, if I start to type in my city it offers of the full city name for me. Clearly it sees a form field name city... and shows me all the values I have typed in to other inputs with a name property of "city". Is there any way to arbitrarily force a field name so we can take advantage of this behavior built into most browsers?

    Posted 12 years ago on Thursday July 26, 2012 | Permalink
  2. David Peralty

    Gravity Forms, to work properly needs names and ID's to be certain values. This was a compromise we made a long time ago to make coding multiple fields in a form as easy as possible. There isn't any easy way to change this and maintain functionality.

    Posted 12 years ago on Thursday July 26, 2012 | Permalink
  3. David,
    Thanks for confirming my gut feeling. I'm considering going down the road of using jquery to change the name attribute to "city" after the form loads, then changing back to match the id either maybe on blur of the field, or maybe if there's a GF hook I can use before submitting.. Not sure I have the strength.. but it could be useful for others if I could pull it off... we'll see. Thanks for the answer anyway.

    PS how great are these forums!!!! Worth every penny and way more!

    Posted 12 years ago on Thursday July 26, 2012 | Permalink