<so***********@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
The browser shows the alert but causes an error "access denied" and
fails to set the upload.value to null. Please help!
for(var i=0; i < fileName.length;i++) {
if (fileName.charAt( i) ==' ' || fileName.charAt(i) == '*') {
document.forms[0].upload.value='';
alert("No spaces/wildcards allowed in file names"
+ f.upload.value);
return;
}
}
Not to mention that's a pretty inefficient way to check for spaces or
wildcards. Let String#indexOf() do the work for you.
if (fileName.indexOf(' ') != -1 || fileName.indexOf('*') != -1)
{
// fileName contains a space or *
}
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq