1

How to drop/hide the "No file chosen" text next to the fileUpload button? file upload

Code for my fileUpload control:

                        <xp:fileUpload id="fileUpload1"
                            value="#{document1.Picture}"
                            rendered="#{javascript:document1.isEditable()}"
                            mimetype="image/jpeg" useUploadname="true"
                            accept="image/jpeg,image/gif,image/png">
                            <xp:eventHandler event="onchange"
                                submit="true" refreshMode="complete"
                                disableValidators="true">
                            </xp:eventHandler>
                        </xp:fileUpload>
  • Can you post the ful code? I am not sure if it is the file upload control which generates this message. – Michael Ruhnau Nov 26 '12 at 15:53
  • 1
    I doubt if this has anything to do with XPages. It is actually Google Chrome rendering `input` with `type` as `file`. In case of IE it renders it differently. This [discussion](http://stackoverflow.com/questions/12035400/how-can-i-remove-the-no-file-chosen-tooltip-from-a-file-input-in-chrome) tries to remove the popup message of "No file chosen", probably could give you some ideas. You could also add tag of "html" to your question. – Naveen Nov 26 '12 at 16:27
  • Thanks for the ideas ... I found a hack that's "good enough" for now ... I set style="width:85px" on the xp:fileUpload – Peter Della-Nebbia Nov 27 '12 at 19:47
  • @PaulDella-Nebbia I came looking for the "hide" and found the event handler as a bonus! Using both now. Thanks! – David Navarre Jun 18 '13 at 16:14

2 Answers2

2

Only works in Chrome: Simply set width of file upload Control to 40% automatically "No File Choosen" text will gets disappear

Dipesh
  • 371
  • 1
  • 4
  • 20
1

Use this answer which basically creates a styled span that hides the underlying input file button: https://stackoverflow.com/a/9164004/785061

Community
  • 1
  • 1
Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76