Check Entry | JavaScriptSource

Check Entry

JavaScriptSource Staff Sep 8, 1999

General

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.


Notes

  • 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


Head

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


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(2 comments)

Your question is beyond the scope of these comments. You will need to post it over on [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]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