Pull form radio value using the label text

Hey Matthew,

(My answer comes from the answer Anna made here: Dynamic Items in Form Select Field - #4 by Anna_Kelian)

Try this out:

(1) Delete the radio button element from your collection item entirely. (You’ll have an empty collection item at this point.)

(2) Add a div to your collection item. You can give it the same class that your radio button parent element had before.

(3) Add two elements to this div:

  • Embed
  • Text Block (class of Radio Button Label)

In the HTML Embed, add the following script:

<script>
document.write('<input ');
document.write('   type="radio" ');
document.write('   name="NAME" ');
document.write('   value="VALUE">');
</script>

You can replace the NAME and VALUE placeholders with values from the CMS by clicking + Add Field in the HTML Embed editor.

Try this out and let me know if it works for you!

1 Like