Well, this good idea may have a good intention at its origin. But
consider the following :
I am developing a project, where there no buttons at all - it was the
wish of my customer. There are many dozens of elements for interacting
with the user, all of them uniformly designed - but for the single
place where an ugly system button would appear, with different look on
every other machine. Even worse, the project is multilingual where the
user must have possibility to switch the language of the entire site -
but for an ugly button stubbornly displaying always the same caption in
the language of the particular operating system...
AFAIK, it is not possible to provide any style for this wayward button,
isn't it?
Thus, the basic idea may have been very good intended. Known however,
that the way to the hell is paved with good intentions.
Any good intended advice for my situation would be highly appreciated.
Victor
David Golightly schrieb:
Randy Webb wrote:
<a
href="javascript:document.forms['upload'].elements['file_1'].click();">
Because FF doesn't support the programmatic clicking of a file input
element.
This is true, but additionally, Firefox doesn't support the click()
method on any DOM object, at all. You have to roll your own:
function generateClick(element) {
var clickevent=document.createEvent("MouseEvents")
clickevent.initEvent("click", true, true)
element.dispatchEvent(myevent)
}
However, even this won't work on the File input element. As far as
scripting is concerned, it's basically read-only - you can't "make" it
do anything. Which is a good thing.
David