6

I use jQuery MultiFile plugin. The upload button below:

Choose File button

Can I change Choose File text to something else?? Web-surfing can't help me.

I just want a "Choose Files" there.

Please, just say *Yes(+and how) or *No.

Thanks!

Vitalyp
  • 1,069
  • 1
  • 11
  • 20

2 Answers2

3

Yes, I found best workaround! This is not a hack - we just need 2 buttons: original, and 'fake'.

  <input type="button" value="Choose Files">
  <input type="file">

Fake is displayed to user, and has

  z-index:1

Original is positioned above it, with

  z-index:2, opacity: 0; position: relative;

and has callbacks:

  :onmousedown=>"buttonPush('depressed')", :onmouseup=>"buttonPush('normal')"

  function buttonPush(buttonStatus) {
    if (buttonStatus == "depressed")
      document.getElementById("fake_btn").style.borderStyle = "inset";
    else
      document.getElementById("fake_btn").style.borderStyle = "outset";
  }

Thanks to this link http://www.dreamincode.net/forums/topic/15621-styling-a-file-browse-button/

Regards @Piskvor, @racar

informatik01
  • 16,038
  • 10
  • 74
  • 104
Vitalyp
  • 1,069
  • 1
  • 11
  • 20
2

No, this is a part of the <input type="file"> control, and the webpage cannot control its appearance.

Piskvor left the building
  • 91,498
  • 46
  • 177
  • 222
  • some workaround here : http://stackoverflow.com/questions/686905/labeling-file-upload-button – malletjo Nov 23 '11 at 13:37
  • @racar: That is indeed a hack - a rather ugly hack, IMHO; and it will get flagged as clickjacking (because it is, however benign): http://www.gnucitizen.org/blog/more-advanced-clickjacking-ui-redress-attacks/ Thanks for pointing out the duplicate, though. – Piskvor left the building Nov 23 '11 at 13:40
  • I understand. Can I hide the file control, and 'activate' it via jquery/javascript ? – Vitalyp Nov 23 '11 at 13:42
  • i agree, but it's not my choice – malletjo Nov 23 '11 at 13:42
  • @racar: I'm not saying it is :) OTOH, adding a piece of code which will trigger severe warning messages (currently in IE9 and FF+NoScript) doesn't sound very user-friendly to me. – Piskvor left the building Nov 23 '11 at 13:46
  • I wondered that we can not use simple solution for this trivial task. I really don't want use any hacking there, and should use flash-plugin to change this ugly text to something else. – Vitalyp Nov 23 '11 at 13:58