Did the id attribute of my Gravity Forms radio and checkbox inputs change?

If you’re upgrading from a version earlier than Gravity Forms 1.8.20.7, yes, it did. The id attribute for radio and checkbox choice inputs now includes the form id.

New Id

<input name="input_2.1" type="checkbox" value="First Choice" id="choice_294_2_1" tabindex="4">

Note the “id” attribute: choice_294_2_1

Old Id

<input name="input_2.1" type="checkbox" value="First Choice" id="choice_2_1" tabindex="4">

Note the “id” attribute: choice_2_1

This might be causing you grief if you had custom javascript code that was expecting the ids to be in the old format. With the recent release of Gravity Forms 1.9, I’ve had more and more people coming to me with issues related to this change. Hopefully this PSA might spare some other folks a small headache.

What are the numbers in the input ID anyhow?

The numbers follow this template:

choice_{formId}_{fieldId}_{inputId}

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.