On the submit form, the file field is cleared in Internet Explorer 9

I think this problem is related to this question:

Clicking on submit clears the file field instead of submitting the form (IE9)

I have the following form and 1 IE9 user reporting a problem. They can view and select a file from their computer. But when they click the button to submit the form, the image field is cleared, and thus the application returns an error to “select the image”.

I can not reproduce the problem.

Upload a photo (step 1 of 2)

<div class="box-content"> <form encType="multipart/form-data" method="post" name="galleryuploadform" action=""> <table> <tbody><tr><td class="field_name" vAlign="top" width="70">Image: <span class="red_highlight">*</span></td><td><input name="photo_image" type="file"><br> <span class="form_hint">All images must be:</span> <ul><li class="form_hint"> JPEG format (.jpg at the end)</li> <li class="form_hint"> RGB format</li> <li class="form_hint">Images will be resized to 1000x1000 on the longest edge (large size) for <a href="http://www.ephotozine.com/e2signup">e2 members</a> and 600x600 (normal size) for standard members</li></ul> </td></tr> <tr><td class="field_name" vAlign="top">Adult: </td><td><input name="photo_adult" value="1" type="checkbox"><br> <span class="form_hint">Tick if your photo contains adult material.<br> <strong>Important:</strong> We do not accept pornographic images and reserve the right to delete such material. </span> </td></tr> <tr><td colSpan="2" align="center"> <input name="action" value="Upload Photo" type="hidden"> <input onclick="submitform('galleryuploadform');display_white_box('photo_upload_lightbox');closeKeepAlive();" name="button" value="Upload Photo" type="button"></td></tr> </tbody></table> </form> <div class="clear"></div></div> 

we have submitform (), which represents the form display_white_box (), which displays a dialog box message with 'uploading' and closeKeepAlive (), which is a fix for Safari on Mac. I switched to a javascript approach for submitting, because if I hadn’t animated the gif in the download dialog, it couldn’t be animated.

As I said, I cannot play it on any computer or in any other browser.

+2
source share
3 answers

There is no decision. This is a bug in Internet Explorer.

0
source

Does your form work with a regular submit button?

It may be, as Joshua Gossett said, but I cannot find any links. So, I ask more about the JS conflict.

I do not think you should put the onclick event on the submit input.

The best way to do this would be to put the onsubmit attribute on the form and put the javascript function in it, which dictates the action of the form when it is submitted.

0
source

I know this is an old problem, but I ran into the same problem and wanted to share what worked for me.

Modify the .htaccess file to put it at the end:

 BrowserMatch MSIE best-standards-support Header set X-UA-Compatible IE=8 env=best-standards-support 

I found the information here .

0
source

Source: https://habr.com/ru/post/1490176/


All Articles