Field inserting <p><br></p> into empty field when using Medium Editor

If i have a field in a form set to use medium editor it inserts

<p><br></p>

into the database when the field is empty. How do I format the data so that if there isnt any data there not to add anything, or how to format it so that is saves empty when it perceives

<p><br></p>

as the input?

I leave it be. When there is no content, the output will be blank.

no it leaves text in the field. If want to show a field on whether it has data in it or not, it won’t work because what would be blank under a normal text field, the medium editor puts extra code in there.

1 Like

-bump

In one of my projects i used

dmx-show="productlangeomschrijving.wordCount().inRange(5, 1000)"

2 Likes

Try it with the stripTags formatter to remove the html and the trim for any white-spaces. If the string is them empty do not put anything in the database otherwise insert the html.

{{ $_GET.input.stripTags().trim() != "" ? $_GET.input : "" }}
2 Likes

Ben, that seemed to do the trick! Thanks you!!!

1 Like