Slattery, Tim - BLS wrote:

So far I have this, Erik, which works in IE but not in Mozilla. Anyone have any other ideas on this? I did this before but lost it in a computer crash.





<form method="get" action='boogie-woogie'>
<input type='file' name='browse' style='display: none;'>
<input type='text' name='file'>
<input type='image' onClick='browse.click();file.value=browse.value;' src='browse.gif'>
</form>



Absolutely right, this won't work in Mozilla. IE allows this kind of addressing, but it's non-standard. Mozilla hews to the standards always. This will work on both browsers:

<script language="javascript>
function getFile()
{
     o = document.getElementById("browse");
     0.click();
     document.getElementById("file").value = o.value;
}
</script>
...
<form method="get" action="boogie=woogie">
<input type="file" name="browse" id="browse" style="display:none">
<input type="text" name="file" id="file">
<input type="image" onClick="getFile()" src="browse.gif">
</form>




Hi, Tim,

You are a life saver. This is so cool. However, the "browse" button in this case is not a browse button but, rather, a submit button. Can you leave this as it is and also give us a submit button? Thanks a ton. This should show my partners in this crime that a submit is definitely possible.

Michael McGrady


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to