It will alert even if you type something like 'John Smith'. Because it has a white space.
Try this better:
<script>
function ignoreSpaces(string) {
var temp = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
temp += splitstring[i];
return temp;
}
</script>
<input type="text" onblur="if(String.lenght(i
cheers =0)
Main Topics
Browse All Topics





by: BatalfPosted on 2003-07-08 at 11:39:36ID: 8879431
Maybe something simple like this:
xOf(' ')>=0){alert('Spaces is not allowed');this.focus()}">
<input type="text" onblur="if(this.value.inde