Update fieldnames in Netlify Form submissions [radio specific]

Greetings!

Is there a way to update the field names in the Submissions view in Netlify?

The fieldnames appear to be the label string instead of the HTML input name attribute of the field. This is odd because the POST url uses the name attribute as a query parameter.

For example I may have a a series of radio buttons that look like this:

<input type="radio" id="red" name="color" value="red"><label for="red">Red</label>
<input type="radio" id="green" name="color" value="green"><label for="green">Green</label>
<input type="radio" id="blue" name="color" value="blue"><label for="blue">Blue</label>

And instead of displaying as “color blue” in the form submissions, it displays as “checkedred blue”. However in the POST url it is form-name=Colors&color=blue.

Thoughts?

Your values and labels are slightly off it seems. Try this, just to make sure:


<input type="radio" id="red" name="color" value="red">
<label for="red">Red</label>

<input type="radio" id="green" name="color" value="green">
<label for="green">Green</label>

<input type="radio" id="blue" name="color" value="blue">
<label for="blue">Blue</label>

Hi Tom!

Thank you for responding. Unfortunately that was just me being a little sloppy with my example code. Still running into the same issue. I was hoping maybe there was a data -* attribute I could add that would allow me to be explicit with what text is shown the submissions screen. Have you seen anything like that (think data-netlify="true" on <form>)?

Not really, no. Did some digging, seems like this syntax should work: Checkboxes and radio buttons in forms

For your form that would look like this:

<fieldset>
  <p>
    <label>
      <input type="radio" name="color" value="red"> Red
    </label>
  </p>
  <p>
    <label>
      <input type="radio" name="color" value="green"> Green
    </label>
  </p>
  <p>
    <label>
      <input type="radio" name="color" value="blue"> Blue
    </label>
  </p>
</fieldset>
1 Like

Thank you Tom, looks like they were experiencing the same issue as I am. I’ll try wrapping the inputs in the label and see if that doesn’t clean it up a bit.

I appreciate you jumping in! If i find the magic bullet I’ll make sure to reply.