Eventually, we will be making the switch to use form builder for all forms by default, unless they include any kind of custom scripting or logic (in which case they must be custom-built). In the meantime, see this doc of current known/existing issues that will be looked into.
Styling
You may need to put these items within purgecss exclude comments, to make sure that they don’t get stripped out by the purgecss tool we have in place. Obviously while we’re building a site initially, these items won’t exist, and only show up in the actual site once it’s on UAT or prod.
Radio Buttons
By default, radio buttons will be white circles on initial view, and become solid blue circles when selected. To change that color, you can use the following style:
jha-form-radio-button {
--jha-color-primary: #fff!important;
}
There are several things to note about this. jha-form-radio-button is not a class, but an attribute, so make sure not to include a . or # at the front. The --jha-color-primary attribute must be an actual hex color value, not a variable, because these items will not be converted. Lastly, they do need the !important flag because they are overwriting the default styles which are set as inline.
Scripting
Trick question–form builder forms don’t get scripts. Forms with any kind of scripts / logic need to be custom-built, no exceptions–scripts just don’t work with the sort of simplicity that form builder was made for.
You won’t need any scripts on the developer side to get Form Builder to work–it’s all done in the CMS.
HTML
When you’re building a page for a form builder, simply create a content area for the form to be placed in. That’s the extent of it–you don’t need a separate content area for a “thank you” message or anything like that. If you’re converting an existing hard-coded form into a form-builder, you can basically replace the entire .ajax-form div with your content area.
JSON
It’d be nice if we could have forms auto-built when you scaffold a site. We’re not there yet, but watch this space and when there’s a way to do that, it’ll be added here. For now, you’ll just need to build the forms with Form Builder directly within the CMS.
Troubleshooting
I placed a form within a content area and it’s not showing up.
This sometimes happens when a content area is only populated with a Form Builder form and no other content. The remove-blank class on the content area removes the area before the form can populate, because it doesn’t detect the form as content. To fix this, put a small amount of content either above or below the Form Builder form. The PCs/CWAs should also be training clients on this.
I have a radio button set, and the label for the initial question isn’t showing up.
This is a known issue on the doc linked above. In the meantime, you can put the initial question into the “Description” field and it will show up as part of the legend.