I want to validate a text box that should not have
- Spaces in the beginning
- All spaces
- Spaces in the end
Here is the textbox code:
<input type="text" id="username" name="username" placeholder="Username..." required="required">
I can't use trim because of the implementation of the code is a bit complex, It would break other functionality. This is only a carry over project to me. So I decided to filter it out on the HTML textbox it self. But I don't know how to do this.
Update:
By the way I'm asking for a regex pattern.