Navigation Menu
Alphabetical Listing
Site Contents

Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Be a Commerce Partner














Internet.com

IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Developer Channel

FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

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


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum. Do not include more than two (2) lines of code in your comments. If you have suggestions or corrections, you can submit them to us.]

    
   
       
[optional]
 
[optional]

   

Comments feed Comment Feed RSS 2.0

1. From: Jeff Bergfeld
What if the file is in a folder with spaces in the name?
10/30/2008 13:43:39

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?

2. From: Lee (Admin)
10/31/2008 11:22:09

Your question is beyond the scope of these comments. You will need to post it over on the JavaScript forum. Thanks!


Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.