I'm currently working on create a page, using XPages, where the users amongst other things are able to upload files. Simply dragging and dropping a File Upload Control onto the page works fine, but I would also like to modify the text on the browse button that is automatically provided by the Dojo framework.
It seems to me that the text on the button is set to the default "browse text" of the system. On other buttons on the page, e.g. the submit button, I am able to set the label of the button (see picture below, which is then displayed as the button's text. This does not work for the browse button...
Does anybody know what I need to do to be able to set the text of the file upload control button to whatever string I want to?
Subscribe to:
Post Comments (Atom)
You cant. Basically, for security purposes, the browser upload control is controlled, pretty much 100% by the browser. You can't style it, you can't change its text, you can't script it. It's meant to have nothing between it and the user as to prevent malicious use of the upload.
ReplyDeleteAll right, then. That's what I kinda was thinking, but still hoping there might be a solution to it...
ReplyDeleteThanks for the confirmation!
It should be possible by putting an image over the 'browse' button, see here
ReplyDeletehttp://www.quirksmode.org/dom/inputfile.html.
Ferry
Thanks for your input, Ferry!
ReplyDeleteI've noticed that IE puts the button after the field, where most sensible browsers put the button before the field. I imagine the hack referenced by Ferry would solve that problem if you want consistency.
ReplyDelete