Not allowing textarea to proceed if enter or space is entered
- Pavel Kravčík
- Member | 1201
You can try custom calback $form->onValidate[] = function()
or something like this:
- McLel
- Member | 12
David Matějka wrote:
You can use a PATTERN validator, e.g:
Thank you for the response. I should've made my question more clear:
I want error message to pop if user tries to enter Space(s) or Enter(s), but I want the textarea to proceed if he enters normal sentence(s).
In other words, if user enters just Space(s) or Enter(s), validation should consider textarea to be empty.
Last edited by McLel (2015-09-30 15:21)
- McLel
- Member | 12
David Matějka wrote:
Oh, sorry. this regexp should work:
.*[^\s].*
Great, I believe we are getting close :-). It returns error if spaces or new lines are entered and proceeds if sentences are entered. I need just one more thing.
I can now send “Hello world” but cannot send
How can I achieve this?