Wondering if there is any work around to Medium Editor fields that have not been used on form submissions sending stray <br> tag in the form submission.
I would not mind stopping them before they insert to database, or getting rid of them later on client side when retrieving the results back.
The reason I am having a problem with this is that the stray <br> tag means that i can not add a condition saying if it’s empty do not display it, because it is never empty. I can not use a replace filter for it either because then real <br> tags are replaced when on the rare occasion the user has entered real data in that field.
Hello Paul,
Try using the stripTags formatter to remove the html and then trim any white-space. If the string is then empty do not put anything in the database otherwise insert the html.
Ahhh, brilliant I knew you would have some idea, haha, you should see the scary things i tried that looked nothing like that. Will let you know if that solves it Teo, thank you
Yes thats how I would normally do it Teo, it was only because I could not get it to have no data initially that i started fiddling around trying to get rid of the extra 30 pixels of white space it was bringing into my design, but yes normally I would do it the way you are suggesting.
Don’t suppose off the top of your head you know a way in MySQL to find all <p><br></p> instances in multiple tables and columns to replace with nothing. I can do it a column at a time and a table at a time, but is there anyway to do them all?
Thats exactly how I normally do it, but I was too embarrassed to say because I thought there was far smarter commands to do it, glad to see my grep txt editor I revert to whenever I have SQL issues is a semi normal thing to do. Lol