August 3, 200917 yr Hi guys, I'm looking for a piece of Javascript that will check if what's been entered into a textbox is all lower case... if so, It will fire up either an alert box letting the user know it's lower case, or a confirmation box saying "Your text is lower case, are you sure you want to submit this?" Any suggestions/pointers are welcomed. Thanks
August 3, 200917 yr Bear in mind that I'm very amateur at JS.. but this is a method of doing it. var compare = userInput.toLowerCase(); if (userInput == compare){ alert('Your text is lower case, are you sure you want to submit this?') } No doubt there is a better method, but it's a start
Create an account or sign in to comment