Forum Moderators: open

Message Too Old, No Replies

making one button click another

         

supermanjnk

8:04 pm on Apr 22, 2005 (gmt 0)

10+ Year Member



I'm using css to absolutly position a button over a
<input name="browse" ID="browse" type="file">
Now I need some way to make it so that when you click that button it automatically clicks the browse button.

gph

2:38 pm on Apr 23, 2005 (gmt 0)

10+ Year Member



Half a solution, I believe click() is IE only.

For xbrowser try a search for "createEvent" and "initEvent"

<input type="button" value="File" onclick="document.getElementById('file').click()">
<input type="file" style="display:none" id="file" onchange="alert(this.value)">