I have an input field for ‘Comment’ with max length set to 140 chars, I have placed a logic to check that if the input field is empty, however, if the user enters just space in the comment input field and submit - an empty string will be saved in the database.
Right now I am trying to prevent this by adding the default value of the input field but it could bypass if the user deletes the default text and then submit it with a space in the field!
Is there any workaround to implement minimum length functionality after trimming the input field? Maybe there should have been a formula for text manipulation like trim() and strlen() functionality.
Appreciate any help.