Welcome to WebmasterWorld Guest from 107.20.54.98

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

Upload button not working in IE

     
8:23 am on Dec 7, 2008 (gmt 0)

New User

5+ Year Member

joined:Dec 7, 2008
posts: 2
votes: 0


Well I'm pretty new to php so this might be a stupid question. I'm making a very simple upload form, it works fine in firefox, but in Internet Explorer there's some weird issue where the upload button won't press. You have to actually click in the text box and hit enter. I have no idea how to even attempt to fix it, if it were up to me I wouldn't bother at all with IE, but some misguided souls still use it and aren't gonna stop. Is there some extra code I'd need for IE? I tried googling it, but I find topics for other issues.
8:47 am on Dec 7, 2008 (gmt 0)

Preferred Member

5+ Year Member

joined:May 29, 2007
posts: 578
votes: 0


If this is happening when loading the file on your local machine (as opposed to an online version) check that you have said YES to the message (that appears just under the address bar) that says:

"To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer.
Click here for options..."
6:01 pm on Dec 7, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Welcome aboard theturtlemoves!

some misguided souls still use it

Actually, most users use IE, I think FF is only approaching something like 20%. So yeah, it's a thorn all right, but shouldn't be a problem with this issue.

Verify a couple things:
1. Yes, this problem exists online, see previous post.
2. Your form has enctype="multipart/form-data"
3. The page it's on validates [validator.w3.org].

Then post some relevant code here, not the whole page, just the form. Be sure to remove site-specific references, see TOS [webmasterworld.com].

1:07 am on Dec 8, 2008 (gmt 0)

New User

5+ Year Member

joined:Dec 7, 2008
posts:2
votes: 0


Yeah I know but its actually growing. :D More people are moving towards firefox which makes me happy. It would also make me happy if IE just fixed all the bugs >_<

heres my form:

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">

<label for="file"> Select a file:</label> <input type="file" name="userfile" id="file">
<button>upload</button>
</form>

Yeah it verifys and the "multipart/form-data" is there, and it is online, I tried it on both my computers and had a few friends try as well. I wanted to check if it was just my settings or not.

I don't think its IE's restrictions, I don't get any error messages and when I click into the text box and hit enter the file does upload.

Thanks for the welcome and the help guys :)

9:28 pm on Dec 8, 2008 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12533
votes: 0


Are you using JavaScript to process that <button> element? You should likely be using an <input type="submit" form element instead.
3:45 pm on Dec 9, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


when I click into the text box and hit enter the file does upload

coopster hit it, I think, your Javascript is broken or not present. Generally a button has no inherent function and requires client side scripting to work. Using a submit button insures it will work. When you press enter from any field except a textarea field, the default action is submit.

5:24 am on Jan 7, 2009 (gmt 0)

New User

5+ Year Member

joined:Jan 4, 2009
posts: 18
votes: 0


I concur, that button likely is lacking a function so it does nothing.