Check Entry | JavaScriptSource

Check Entry

JavaScriptSource Staff Sep 8, 1999


This script prevents the user from selecting a filename with a space (known to cause problems with some scripts). The visitor is informed that the field cannot have spaces. You could also change the character it checks for to something else to suit your needs.


  • Posted: September 8, 1999

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: checkEntry.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Your question is beyond the scope of these comments. You will need to post it over on [a href=""]the JavaScript forum[/a]. Thanks!

Lee Oct 31, 2008

I'm trying to validate that the file name does not contain spaces. This script works for that, except when the file is in my "C:/Documents and Settings/" folder. It's picking up on the spaces in the "Documents and Settings" folder name. Is there a way to start checking past the path name and only check the file name?

Jeff Bergfeld Oct 30, 2008