Please note the .getElementById(...) that contains the field ID and the desired value that is going to be what you want to have in the field.
You can also use the Embed option :)
Also if you want to add a value so you can style the text accordingly in the input, you can simply go to Preview Mode, click on the field and type something in. After you leave Preview Mode the value will persist for you to style. It is important to remember, that value added that way is not going to be rendered on published site and will disappear on next designer refresh or page switch
Just one more thing I’d like to get your opinion on.
I need to assign an XYZ value to checkboxes because I’m trying to implement the mixItUp plugin advanced filtering (kudos to @sabanna for creating an amazing tutorial for this) with dynamic embeds.
Here’s what I’ve done so far. Apart from the horrible styling (that is just my sandbox) I achieved the overall result of getting the plugin to work. Here’s the actual result.
As you’ll see, “sabanna’s method” requires using embed code for assigning XYZ value to checkboxes, which is fine but has some cons if you want do some fancy with those checkboxes.
Your method on the other hand seems to be the way to go. However, as in my project I’ll be needing about 30-40 checkboxes, it might be difficult to implement it. Lots, lots of code would need to be added, wouldn’t it?
Thoughts?
PS: One last thing while we are on this subject.
As you’ll see in my preview link, I’m using a bit of code.
Question: any way to consolidate this piece of coding into something smaller and more appropriate from a purely semantic point of view?