Search code examples
xpages

How to hide "No file chosen" text on xp:fileUpload control?


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>

Solution

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