O
oopaevah
I want to have a separate button which invokes the "browse" button on
an input type=file. In internet explorer the following code works ok,
in firefox nothing happens.
All I do is call click() for the input control.
Do you know how to make this work in firefox?
Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<script type="text/javascript">
function test()
{
var oTest = document.getElementById( "mytest");
oTest.click();
}
</script>
</head>
<body>
<form id="myform" action="test.aspx" method="post">
<input type="file" id="mytest" value="monkey" />
<br />
<input type="button" value="Programmatically Invoke The File
Browser Dialog" onclick="javascript:test();" />
</form>
</body>
</html>
an input type=file. In internet explorer the following code works ok,
in firefox nothing happens.
All I do is call click() for the input control.
Do you know how to make this work in firefox?
Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<script type="text/javascript">
function test()
{
var oTest = document.getElementById( "mytest");
oTest.click();
}
</script>
</head>
<body>
<form id="myform" action="test.aspx" method="post">
<input type="file" id="mytest" value="monkey" />
<br />
<input type="button" value="Programmatically Invoke The File
Browser Dialog" onclick="javascript:test();" />
</form>
</body>
</html>