Hi... I have this javascript validation for an upload feature I created on an ASP page... the validation works fine on IE... but the submit button doesn't even click or there is no activity when the submit button is clicked but the file get UPLOADED in the background...on NETSCAPE 7.1 (only on PCs) Netscape on MACs works fine. As you can see the validation should work for the paper title and the file being uploaded... Can anyone help me with this please? Thanks a lot.
HERE IS THE CODE:
HERE IS THE CODE:
Code:
<script language="javascript">
function fun () {
var path = document.upform.blob.value;
var pattern = /\s/;
file = path.split("\\");
file.reverse();
if (pattern.test(file[0])) {
alert ("Your filename includes spaces. Please rename your file per the guidelines on this page and try again.");
} else if (document.upform.docName.value.length == 0){
alert("Please enter the Paper Title");}
else {LimitAttach(this.upform, this.upform.blob.value);} //{document.upform.submit();}
}
extArray = new Array(".htm", ".html", ".pdf", ".doc");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("Please only submit files that end in: "
+ (extArray.join(" ")) + "\nPlease select a new "
+ "file and try again. Thank you.");
}
</script>