I have form where a user can add more input boxes on button click. User can have as much input boxes as they want.
I do not plan to add a button for removing fields.
They default number of input boxes is 2. Say the user decides to add 3 more, now there are a total of 5.
For validation, I would like to check if the input box is empty or if the input has all spaces like: " " no matter how many spaces as long as it has nothing else but space. I can do the check for an empty input by checking length, but how can I check for the latter? Is there a regular expression for any number of consecutive spaces? Thanks!
PS: I am using jQuery with jQuery mobile