Streaming live at 10am (PST)

Change Webflow checkbox default value


#1

Hi Bart,

I have tried this, but this doesn't seem to work, anymore.
Can you confirm that this method isn't working anymore?


Custom Attribute "Value"
#2

This should still work.


#3

I've tried both the before /body tag in custom code, as well as an embed.
I still get "true" in my forms overview, instead of the "desired value".
Or is this only possible with text inputs?

The read-only link: https://preview.webflow.com/preview/ixstudios?preview=374198f21a3e5257a6a022e623dec4f1

The code is:

<script>
  Webflow.push(function() {
    document.getElementById('opdracht-3dlogo').value = "3D Logo Ontwerp";
  });
</script>

The ID of the checkbox-settings is "opdracht-3dlogo".
But after submitting, the field still remains "true" instead op "3D Logo Ontwerp"

I've also tried ElementsByName but it still isn't working.


#4

There are 2 'worse' solutions.

  1. Using Zapier to replace.string "true" to the correct value. But to do this for 40+ checkboxes, this is a lot of work and not very flexible.

  2. The other option is to use the "select" form object and use "multiple allowed" However, this requires the use of the CTRL key to select multiple items, and there is no possibility to style the selected options. This impacts the usability too much.

If there was only a way to rewrite the value of the checkbox fields - i could get this working in 30 minutes. The other 2 options (above) would cost about a whole day to get this working.


#5

I do not see it anywhere in your page source view-source:http://ixstudios.webflow.io/, which page did you insert it on?


#6

It's a page not in the navigation for now:

You can find it here: http://www.ixstudios.nl/opdracht-formulier
Or: http://ixstudios.webflow.io/opdracht-formulier

EDIT: I'm working on it constantly. Now i've embedded code and added a cystom value to the following checkboxes:

<input name="SERVICE-3D-Logo-ontwerp" type="checkbox" class="checkbox w-checkbox-input" id="SERVICE-3D-Logo-ontwerp" value="3D Logo ontwerp" data-name="SERVICE 3D Logo ontwerp">

<input name="SERVICE-Huisstijl-ontwerp" type="checkbox" class="checkbox w-checkbox-input" id="SERVICE-Huisstijl-ontwerp" value="Huisstijl Ontwerp" data-name="SERVICE Huisstijl ontwerp">

But even with the values in here, WF still reports "true/false" when a form is submitted.


#7

Also with the addition of this script - the results remain the same:

<script>
  Webflow.push(function() {
    document.getElementById('SERVICE-3D-Logo-ontwerp').value = "3D Logo Ontwerp2";
  });
</script>

Unfortunately i've come across this link: https://forum.webflow.com/t/add-checkbox-values-to-forms-for/29945/4


#8

Ah, the problem is you cannot change Webflow checkbox value. Please see the official reply here:


#9

@cyberdave

Is there any view on a future feature that will make this happen.
I now have to completely rethink and rebuild 2 large forms i have been building, because i knew this is possible with regular HTML.

This is, unfortunately, and despite the awesomeness of WF, a major problem for me and 2 clients of mine.
Do you know of any work around?

I'd appreciate the/any help i can get!


#10

The option for Zapier isn't a viable one. Zapier limits the max. ammound of rewrites you can perform, and this limits the replace-string option in a way it is not usable anymore.

I have build a perfect assignment-form that i'd really like to start using as soon as possible, but with the locked checkbox-values, there is no way to get it operational.


#11

This topic was automatically closed after 60 days. New replies are no longer allowed.