Script Categories

Forms >>> Trim Trailing Spaces.

A super-easy script which eliminates any extra trailing spaces entered inside a textbox. To check it out in action, try entering a few spaces after the text in the box.


Add the below code to the <body> section of your page:

<!-- Visit for full source code
and get more free JavaScript, CSS and DHTML scripts! -->
Filename:  <input type=text name=filename size=40 value="file.txt" onChange="javascript:while(''+this.value.charAt(this.value.length-1)==' ')this.value=this.value.substring(0,this.value.length-1);"><br>
<input type=submit name=action value="Done!">

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.

Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).