Radio and Checkbox inputs: Set custom labels with different text than returned 'Value'

Right now, you can only set the ‘value’ of a checkbox or radio button in the Bubble editor which ends up being the same content as the checkbox label (what’s visible on-screen) and then sent to Bubble workflows for processing.

I’d like to be able to display a list of checkboxes like

  • Sedan
  • SUV
  • Truck

But have the values returned to Bubble be:


How it works now:

<input type="checkbox" name="vehicle" value="Sedan">
<input type="checkbox" name="vehicle" value="SUV">
<input type="checkbox" name="vehicle" value="Truck">

How I’d like it to be different:

<label><input type="checkbox" name="vehicle" value="Sedan_123xyz">Sedan</label>
<label><input type="checkbox" name="vehicle" value="SUV_321abc">SUV</label>
<label><input type="checkbox" name="vehicle" value="Truck_456jkl">Truck</label>

Thoughts? Maybe I’m missing something…

To clarify, do your radio buttons rely on a database search or are they simply text elements?

With a database search, you’re looking at defined things (which are represented as Radio button options based on the field you want to represent). The defined attributes you call on will let you write it however you wish to the database.

Otherwise, if you’re using straight text and not a database search, you could use a series of “find and replace” functions.

My solution is to create custom options in data/options exp:

  1. option title 1
  2. option title 2
  3. option title 3
    and then create an attribute “custom_options_value” type “text”, now you can add value for every option.

And on front, you chose dynamic choices
Type of choices: “States_Custom_options”
Choices source: “All States_Custom_options”
Option caption: “Curent option’s Display”