Jump to content

Warning User Not To Enter Spaces In Username Field


Dan_Mason

Recommended Posts

Okay, so this is the code i have so far (as an example):

 

<script language="javascript" type="text/javascript">
function removeSpaces(string) {
return string.split(' ').join('');
}
</script>


<form>
<input type="text" onblur="this.value=removeSpaces(this.value);">
<input type="button" value="Click">
</form>

 

 

As you can see, I am automatically removing spaces in the field. Now I know it would be obvious to most people but the majority of people using the login system I am designing are going to be pretty computer illiterate, So i need it to be obvious.

 

 

I want to also have a warning pop-up box If spaces are found and removed saying "Spaces cannot be used in Usernames, spaces have been removed."

 

Can anyone help?

 

 

Thanks in advance :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.