I’ve made a form, for uploading an image, it works good on IE,Firefox.
But on chrome the browse button doesn’t work.
This is the browse button:
<input type="button" name="brw" id="brw" onClick="img.click()" />
When you click this button you fire up img fields browse function.
Other fields:
<input name="img" type="file" value="" style="display: none;" onChange="txtFilename.value = this.value;" />
And when you select the image you get images name in this disabled text field.
<input type="text" name="txtFilename" id="txtFilename" disabled="disabled" />
Any solution for crossbrowser, would save my life 🙂 .
Thx all.
Look here and here (second answer). Input of file type cannot be hidden, by setting
display: noneyou have to hide it in another way. In my example I setvisibility: hiddenor you can play with opacity (like in the other answer).