ie/mac - onChange problems for file input

D

DonD

I have a form that allows a user to upload a file. When they select a
file (onChange), I call a JS function that analyzes the filename for
specific keywords and then populates a multiple select box with the
keywords.

The problem is, IE for Mac doesn't do the onChange properly. In all
other browsers, as soon as I select the file, the onChange fires and
the filename gets analyzed, etc. In IE for Mac, I have to click away
from the file input box for the onChange to take effect. The user won't
know to do this.

I've tried a ton of things already, including setting timers that force
the file input to lose focus. Nothing seems to work.

Here's a link to the page:
http://web.cfa.arizona.edu/memoria/tools/upload.php

Anyone have any ideas?

Thanks.

--Don D.
 
R

RobG

DonD said:
I have a form that allows a user to upload a file. When they select a
file (onChange), I call a JS function that analyzes the filename for
specific keywords and then populates a multiple select box with the
keywords.

The problem is, IE for Mac doesn't do the onChange properly. In all
other browsers, as soon as I select the file, the onChange fires and
the filename gets analyzed, etc. In IE for Mac, I have to click away
from the file input box for the onChange to take effect. The user won't
know to do this.

onchange is supposed to fire when the control loses focus, so in fact
IE Mac is doing it by the book.

"The onchange event occurs when a control loses the input focus and
its value has been modified since gaining focus. This attribute
applies to the following elements: INPUT ,SELECT , and TEXTAREA ."
<URL:http://www.w3.org/TR/html4/interact/scripts.html#adef-onchange>

What's the fix? Change your UI so that users know to click away from
the input, say with an 'analyse file path' button or such. Or just
expect that some users will not have their path analysed - those
without JavaScript won't either.
 
D

DonD

Rob,
Thanks for the response. I think the other browsers are doing it
according to spec also. The difference is that they blur the file input
field automatically, which is nice. There's no reason not to. I feel
like IE/Mac is being lazy.

I'll consider the exta button. I was hoping I wouldn't have to do that.
It's a pretty streamlined process when it auto-analyzes.

Thanks again.

--Don D.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top