You need to sign in to do that
Don't have an account?
How can we change the value of browse button
Good day All,
I have create input file component in the page. some questions here
1. How can i change the text value of "browse" button, currently it show me 'Browse' ?
2. How can 'Browse' text value get change based on different language ? we can't have label for 'Browse' text value right ?
Thank you !
VF page :
<apex:form id="theForm"> <apex:pageBlock > <apex:pageBlockSection > <apex:inputFile value="{!document.body}" filename="{!document.name}"/> <apex:commandButton value="Save" action="{!save}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form>
I don't think you can change the text of the Browse button. This is produced by the browser and is intentionally not under the control of your page/javascript as it allows access to files on the user's os. This is to stop unscrupulous page author's making the browse button look like something else and conning the user into uploading sensitive data.
I would expect the text of the button to change according to the locale of the user's underlying OS.
You might try the technique described here:
http://www.quirksmode.org/dom/inputfile.html
Hi,
I am looking to create this browse button in a custom object on my org. I believe you are referencing the visualforce page in a custom button right?
if so, can you please send me your full page code so I cam implement this.
Cheers
@all: The solution is to :
1. create a custom input text element with the standard button styling
2. overlay that element on top of the "choose file" button
3. write javascript code to handle the click on the custom element
4. trigger the click() of standard "choose file" when custom element is clicked.
You may find the solution described in detail with code on my blog post --> https://sfdc-gyaan.rhcloud.com/2014/05/renamingoverriding-choose-filebrowse-button-in-salesforce/
I hope this helps.