Hi,
I need to capture an event on a form file input button and present a
dialog before allowing the user to browse for a file. (A customer
needs this in a CMS that I'm customizing for them.) Capturing the
click is easy:
<form>
<input type="file" id="theButton" />
</form>
function theFunction() {
// do something
return false;
}
document.getEle mentById("theBu tton").onclick = theFunction;
The function presents a TOU in a div; when the user clicks "I Agree"
the browse dialog should appear. Everything works but forcing the
browse dialog to appear after accepting. I assumed something like
document.getEle mentById("theBu tton").onclick = theOriginalFunc tion;
document.getEle mentById("theBu tton").click();
would work, but no dice. focus() doesn't work, either.
Ideas? This needs to be cross-platform, but I'm developing on OS X w/
Firefox 3.
Thanks,
Walter
I need to capture an event on a form file input button and present a
dialog before allowing the user to browse for a file. (A customer
needs this in a CMS that I'm customizing for them.) Capturing the
click is easy:
<form>
<input type="file" id="theButton" />
</form>
function theFunction() {
// do something
return false;
}
document.getEle mentById("theBu tton").onclick = theFunction;
The function presents a TOU in a div; when the user clicks "I Agree"
the browse dialog should appear. Everything works but forcing the
browse dialog to appear after accepting. I assumed something like
document.getEle mentById("theBu tton").onclick = theOriginalFunc tion;
document.getEle mentById("theBu tton").click();
would work, but no dice. focus() doesn't work, either.
Ideas? This needs to be cross-platform, but I'm developing on OS X w/
Firefox 3.
Thanks,
Walter
Comment