Hi,

I have a form to upload a photo/file. I have the following html code
snippet.

<input type="file" id="file" style="display:none;"/>
<input type="text" id="file_visible"/>
<input type="image" src="image.jpg" onclick="clickFile()"/>

The problem is that I don't want to show the default "Browse" button
with the input type="file".
So, I have made the first input invisible, and instead, I am showing a
text field and an image button.

I want to trigger the click event of the first element.

Here is the js code.

function clickFile(){
       $('#file').click();
}

This seems to work in IE, but it doesn't work in other browsers. And
also, I want to copy the contents of the invisible input field to the
text field after the user has selected a file. Can this be
achieved ???

Thanks,
Dexter.

Reply via email to