You need to sign in to do that
Don't have an account?
mds_tanvi
add javascript on button click
Hi guyz,
i wanna call a javascript method written in a js file on a custom button button click but m not able to add my javascript file. I have included the javascript file in the static resources. But can anyone help me how i can add the static resources on the click of the custom button.
Any help would be highly appreciated ...
Hi Tanvi,
First you need to include that java script file in the page .
Ex- if you are stored your js file with name of MyJavascriptFile in static resources then you can include like this -
<apex:includeScript value="{!$Resource.MyJavascriptFile}"/>
And if you stored a zip folder (given name -LibraryJS) in static resource, then you need to pass also the path of file in respect to zip folder like -
<apex:includeScript value="{!URLFOR($Resource.LibraryJS, '/base/subdir/file.js')}"/>
Now you can use the function defined in that file.
I assume you asking about, how to include your Javascript file into the Standard layout pages. There is no direct way to do it as of now. There are some hacks like specifying the script tab as part of the Section name etc. Search inthe forums and you will find more details about it.