开发者

OnSubmit is not working in IE 8

开发者 https://www.devze.com 2022-12-11 05:25 出处:网络
Everything was working fine in Internet Explorer 6 but it\'s not in Internet Explorer 8. I will appreciate help from anybody. I want to know what I should change to make it work in IE8.

Everything was working fine in Internet Explorer 6 but it's not in Internet Explorer 8. I will appreciate help from anybody. I want to know what I should change to make it work in IE8.

This is the code I am using in the form:

<form METHOD="POST"
  ENCTYPE="multipart/form-data"
  name="form1"
  onSubmit="checkFileUpload(this,'GIF,JPG,JPEG',false,800,'','','','开发者_高级运维','','');return  document.MM_returnValue">

This is the javascript code I am using:

<script language="JavaScript">
  function checkFileUpload(form, extensions, requireUpload, sizeLimit, minWidth, minHeight, maxWidth, maxHeight) { //v2.09
    document.MM_returnValue = true;
    for (var i = 0; i<form.elements.length; i++) {
      field = form.elements[i];
      if (field.type.toUpperCase() != 'FILE') continue;
      checkOneFileUpload(field, extensions, requireUpload, sizeLimit, minWidth, minHeight, maxWidth, maxHeight);
    }
  }
</script>

Thanks


I'm not sure why you have it structured at two statements, but this MAY help:

onSubmit="function() {checkFileUpload(this,'GIF,JPG,JPEG',false,800,'','','','','','');return document.MM_returnValue;}"


I noticed that checkFileUpload is defined with 8 arguments and you're calling it with 10. Also, the last 4 or so look like numeric arguments, but you're calling it with strings.

I don't think it's onSubmit that's not working; and you could verify that by putting alerts in a few places. I think IE8 is being a little more critical of your programming.

I'm not a big Windows person, but I know there's an option in the Internet settings that tells IE to report errors to you. I think you should set that option.

0

精彩评论

暂无评论...
验证码 换一张
取 消