tobimori / kirby-dreamform

✨ DreamForm is an opiniated form builder plugin for Kirby CMS that makes forms work like magic
https://plugins.andkindness.com/dreamform
45 stars 7 forks source link

Empty error-div is included already on load and if there is no error. #49

Closed animaux closed 7 months ago

animaux commented 7 months ago

The following code is always included in the form. Apart from semantic/redundancy reasons this creates an empty box when styling the error message with a background and padding:

<div class="error" data-error=""></div>

Skjermbilde 2024-05-03 kl  11 13 30
tobimori commented 7 months ago

This is expected behaviour, so it's easier to show errors when using API submission mode.

If you want to customize it, you can override the error snippet in site/snippets/dreamform/fields/partials/error.php and site/snippets/dreamform/form.php wrap them both in an if statement.

However, my recommended solution would be to hide the div with .error:empty { display: none; }.

animaux commented 7 months ago

Hmn ok. Already did that as a quick fix. Support is quite good nowadays.