I have a situation where users are adding a space to the beginning of a text field in order to have the entry come up first when sorted alphabetically.
Is there a way to force the first character in an input to be an actual letter or character?
I have a situation where users are adding a space to the beginning of a text field in order to have the entry come up first when sorted alphabetically.
Is there a way to force the first character in an input to be an actual letter or character?
Maybe you can just trim whitespace on the server side when storing the value?
Hmmm, but wouldn’t that trim all spaces in the entry? I need to allow spaces, just not as a first character.
I believe the trim formatter should only remove white space from the beginning/end of a string.
That would be great, I will experiment. Just gotta figure out how to do it
Thanks Teodor
Just apply the formatter to the $_POST.var expression in the insert record step.
Worked like a charm and I discovered a couple other very useful formatters such as Strip Tags in the process.
Thank you again, Teodor.
I want to do this client-side, does anyone know how to do this once the input is no longer focused?
Edit: Ok, found a way, I’ve added a Dynamic Event “On submit” to the form element, and there I set the value of the input field to the value itself with .trim()
You can use on blur event for the input:
dmx-on:blur="text1.setValue(value.trim())"