ahmedkl Posted June 13, 2010 Share Posted June 13, 2010 I want to check if that an input field doesn't have any spaces in it for example input :text abc is invalid textabc valid. so can anyone help me on how to do this Quote Link to comment Share on other sites More sharing options...
Alex Posted June 13, 2010 Share Posted June 13, 2010 Use indexOf: if(input.value.indexOf(' ') != -1) { // Contains a space } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.