Hi I have a form on one of my pages for entering in information such as names etc
I have some code that will make sure the first letter is always capitalised and the rest lowercase.
What I want to do is expand upon this and use substr to remove everything after the first space.
So if a user goes to enter in the first name field "John Smith" you would only get John
Below is current code
<input onblur="this.value = this.value.substr(0, 1).toUpperCase() + this.value.substr(1).toLowerCase();" type="text" name="last_name" value="lastname" size="10">