1

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.

alain.janinm
  • 19,951
  • 10
  • 65
  • 112
simultsop
  • 740
  • 1
  • 12
  • 31

1 Answers1

1

Look here and here (second answer). Input of file type cannot be hidden, by setting display: none you have to hide it in another way. In my example I set visibility: hidden or you can play with opacity (like in the other answer).

Community
  • 1
  • 1
Beniamin
  • 3,198
  • 2
  • 19
  • 17