tdavis
10-13-2006, 07:41 PM
I wrote the following to make sure that the images that my script will be uploading do not have embedded blanks. It works fine, but not on a MAC. I did not discover this because I do not have a MAC. but the person that I wrote this for does, and she cant use it because of this problem. I suspect it has something to do with me splitting the path up with the backslashes. Is it possible to make this work with a MAC?
Thanks,
-tdavis
var elmArray = document.upload.elements;
for (var i=elmArray.length-1;i>-1;i--){
if (elmArray[i].type == "file" && elmArray[i].value != "") {
var text = elmArray[i].value;
var spit = text.split("\\");
//alert(text);
for (x in spit)
{
count++;
}
text = spit[x];
for(c=0;c<text.length;c++) {
if(text.charAt(c)==' ') {
blerrors++;
elmArray[i].className = "inputreq";
}}}}
Thanks,
-tdavis
var elmArray = document.upload.elements;
for (var i=elmArray.length-1;i>-1;i--){
if (elmArray[i].type == "file" && elmArray[i].value != "") {
var text = elmArray[i].value;
var spit = text.split("\\");
//alert(text);
for (x in spit)
{
count++;
}
text = spit[x];
for(c=0;c<text.length;c++) {
if(text.charAt(c)==' ') {
blerrors++;
elmArray[i].className = "inputreq";
}}}}