Hi! I am new to both FM and BetterForms. I thought I ran across a training video that shows how to implement JS into BetterForms. Does anyone know a good resource for this? I am trying to create a character count in a field and feel like this can be done in BetterForms. Your help is greatly appreciated. Thank you!
JS can be added to nearly any part of BF.
What is your use case?
One common way to sprinkle in JS is in a function
action.
The function action will allow you to open the JS code editor and that JS will run when the action is called.
Many video examples have bits of JS in them also.
Thank you! I’ve found a video that has some JS in the live coding. I am attempting to put a live character count with max length in a field. I appreciate your help!
ok, for this since you want it live I would add a _calc
to the data model and render that
Something like ( in the data model tab )
{
"description" : "",
"descCharCount_calc" : "model.description.length"
}
Then to render in an HTML block:
<h1> The description length is: {{ model.descCharCount }} chars</h1>
Thank you for your help!