Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [javascript]

Javascript is a weakly typed interpreted programming language primarily implemented by web browsers to allow for client-side scripting. It can be used in Visualforce pages to give a more dynamic experience to end users. Additionally, the Visualforce engine generates and uses JavaScript to support the functionality of some of its components.

Filter by
Sorted by
Tagged with
8
votes
2answers
22k views

Javascript SOQL Query in a Button

I am trying to runa query in a .js button to pull out an ID of a contact that is associated with a record so I can auto send an EchoSign document. However I can not get this working, my googling ...
2
votes
1answer
985 views

Comma separated values in visual-force page using query or java-script

I have a field which displays values in visualforce Page as follows "a;b;c;d" i want the values to displayed as comma separated values as "a,b,c" I using a repeat tag inside which i have field {!a....
-3
votes
2answers
2k views

Custom JS confirm button for IF

I need a confirmation alert box to pop up if shipping is set to 0. If the user pressed ok it should redirect to the quote, if the user presses cancel it should stay on the current page. I am using a ...
2
votes
1answer
4k views

Hide/Show Text Field Based upon Radio Button

I have 3 radio buttons in my visaulforce page, and 2 text fields. When I click the first radio button, at that time the first text field should be displayed. When I click the second radio button, the ...
0
votes
1answer
25 views

I have reference ID and i have to display it dynamically but its not working!

Here is the code that i written: <script> function myFunction(var num) { alert("Claim form has been successfully created with reference number:" + num); } <apex:commandButton action="{...
2
votes
2answers
2k views

Saving JQuery Toggle State on Home Page Component

I have an HTML Area component on the homepage that contains an iFrame that is toggled either visible or hidden on button click. I'm using the JQuery toggle function to do this. Currently the div for ...
1
vote
2answers
184 views

Dynamic Account Search Report on Sidebar

The following homepage component passes the value from an HTML input to a URL, using the value as the filter criteria for 3 separate parameter values. Everything works fine, except it doesn't submit ...
1
vote
1answer
11k views

calling or using javascript function inside actionSupport

I have a pageBlockTable with rows, I want to call function from javascript or write a js function when I click on row. <apex:pageBlockTable var="c" ...> <apex:column ../> <...
3
votes
1answer
4k views

highlight single selected row in table

I have a table with rows, i want to highlight the selected row to do some actions on it. I used onRowClick and give it background color, but if i click on anothe row, it highlight two rows .. how to ...
3
votes
2answers
2k views

How to use 'in' clause in salesforce ajax query?

In document.ready method i am doing this var setIds=new Array() //array of saleforce ids $(sel).each(function() { setIds.push("'"+$(this).attr('id')+"'"); ...
0
votes
1answer
818 views

Modifying pages in managed package

I have a requirement to add some javascript/jquery to a page from managed package. Is it possible to do that? Also, please let me know if I can do DOM manipulation of visual force pages which are ...
0
votes
1answer
768 views

IsPickVal having issues inside of OnClick Javascript

For some reason this if statement is always triggering regardless of if the criteria is met or not. {!REQUIRESCRIPT("/soap/ajax/27.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/27.0/apex.js")} ...
1
vote
0answers
204 views

Saving state in OpenCTI iframe between page loads

We have an in-house OpenCTI adapter that we use with salesforce. It's primary responsibility is to find associated records and pop the results when a new call comes in. We have a tendency to have ...
4
votes
0answers
347 views

OpenCTI Screen Pop only when window is in focus

We have an in-house OpenCTI adapter that we use with salesforce. It's primary responsibility is to find associated records and pop the results when a new call comes in. We have a tendency to have ...
2
votes
1answer
215 views

Not able to send email after manage package

I have create a custom object in which i have a custom button to send email. I was able to send email. Until i packaged it. My code before package: {!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")} {...
3
votes
1answer
7k views

Looking for a simple JavaScript “confirm action” dialog

I have a Visualforce page with a custom link that calls a function in the page's controller extension. Before that function gets called, I'd like to use JavaScript to pop up an confirmation dialog box ...
17
votes
5answers
5k views

Javascript remoting and apex date design pattern

I'd like a clever way to handle this in all my code from now on. I have some existing methods that do date calculations in apex...some use the businessHours object and some don't. Many surface ...
2
votes
1answer
973 views

Liveagent post chat page

I have a VF page to send visitor to a survey on completion of chat but I do not want to send this to a cancelled chat user. I have the redirect working but cannot close the window if visitor never ...
0
votes
3answers
4k views

How to change attribute value in javascript

<apex:commandButton value="Default View" action="{!showlist}" styleClass="input" id="hide1" disabled="true"/> <apex:commandButton value="Quote List" action="{!view}" styleClass="input" ...
3
votes
1answer
86 views

How do you cleanly apply native / VisualForce styles to elements created from JavaScript?

Are there any JavaScript UI APIs / libraries to help you build native looking UI for elements created using JavaScript? For example, say I get a list of Contacts via JavaScript remoting. I want to ...
1
vote
1answer
357 views

ExactTarget - how to prevent a SSJS Send(); function from being executed when Landing Page loaded?

I currently have the following Landing Page code in place which is to be placed in a Script Activity and run on schedule every day. var uis = "z_Testing" var esd = Send.Definition.Init(uis); var ...
2
votes
2answers
380 views

Dynamic text field

I have a text field for which I wrote add error methods like it can be only numeric and cannot be less than 5 characters.. Is there anyway that I could display error messages as soon as user starts ...
1
vote
1answer
219 views

Suggested date & time pickers for ExactTarget Landing Pages using AMPscript?

We're trying to determine an easy and usable solution to allow our administrators to have a date & time selector (almost certainly jquery or javascript based) available for forms built in ...
1
vote
1answer
220 views

Ascii characters in window.open();

I am trying to use window.open(); to open a new window and to add parameters to the end of the URL. However when I enter curly braces {} it converts it to the hex code (%7b and %7d). Does anyone know ...
2
votes
2answers
7k views

Using {!User.Profile} merge field in Javascript if statement

I have a business requirement where a new Quote record cannot be generated for a couple different Opportunity types. If the user tries, they get an alert. I've overridden the standard New Quote ...
4
votes
3answers
3k views

Redirect Visualforce page issue

We have created a custom object"Sample", in that we have created a custom button "New record". When we click that new record button it will go to new page where we create new account. which is similar ...
2
votes
4answers
920 views

Compare values in pageBlock using JavaScript

I want to have a little validation when user enter value into apex:inputText it compares it with apex:column, if difference is more than 10%, it would alert the user. Probably it would be triggered ...
2
votes
1answer
509 views

Salesforce Javascript SOAP API

I have a visualforce page with controller class etc. everything works fine under when I login with my own salesforce account (administrator). but When I login with a sales agent account, the page ...
5
votes
1answer
3k views

How to use the sforce.one.navigateToList method?

I see in the Salesforce1 Developer Guide the section on Managing Navigation has documentation on the navigateToList method. navigateToList(listViewId, listViewName, scope) Navigates to the ...
4
votes
2answers
2k views

How to create and save a Task with URL button without navigating to Task screen

I have a url custom button on the Lead and Contact record. It creates a completed task on that record. However, I would like it so that when I click on the button, called "Log a Visit", the screen ...
4
votes
1answer
2k views

Sharing / without sharing and @RemoteAction

I have a global class (without sharing). One of its method is a @RemoteAction, which instantiate another class (public and without sharing) and uses one method of the instantiated class. This method ...
0
votes
1answer
731 views

problem with actionfunction

I have a page with actionFunction to get a parameter onclick on an outputLink from 3 defined. but this warning appear after loading the page before I click on anything.. hitMe=function(one){A4J....
1
vote
1answer
1k views

Placing Server Side JavaScript within AMPscript

Is there anyway to place Server Side JavaScript within AMPScript? For example i have a JavaScript function getLink() which returns a link and i want to place it within a AMPscript TreatAsContent ...
1
vote
1answer
297 views

Navigating to Salesforce Record

I am trying to navigate to respective record's detail page for a recordid when I click on Google Maps marker from JavaScript, but it doesn't work. Am I missing anything? Below is the code. google....
0
votes
3answers
1k views

Standard Delete button override in salesforce Not redirecting as expected

Hi I am trying to override standard delete button for a object "Claim" for a particular user role to prevent from delete & for other user roles the record should get delete. when i try with below ...
0
votes
0answers
2k views

call java script function On Change event of ActionSupport

I am using CKEditor to rerender the rich text area. Due to requirement,on change event of look up field, I need to get related information and display on Rich Text Area. I am able to get info, but ...
2
votes
1answer
562 views

Force.com REST API refresh_token not working?

I am working with force.com REST API using PhoneGap, JQuery mobile By using REST-API tool kit if found it in Github. I am using ChildBrowser for authentication. What i am doing is first i am logging ...
0
votes
2answers
495 views

Button click i want to select the select option value as 'Equal'?

<b><a href="#" onClick="clearValue()" > Clear </a> </b> <script> function clearValue() { document.getElementById('{!$Component.page1:form1:input1}').value=''; document....
1
vote
0answers
273 views

IE browser issue working with java script

I was trying to open a subtab using javascript, in the js console in IE browser and I am getting this error: URl does not exists But the URL is correct and its opening in Firefox browser the way I ...
5
votes
3answers
2k views

Javascript in Apex page

I have a helper Apex page to be included in custom button as Javascript. The page is the following: <apex:page contentType="text/javascript" contorller="HelperController"> function initialize() ...
1
vote
2answers
6k views

How to close the window when clicked and open the new window [closed]

<apex:commandButton value="Search Again" onclick="return window.open('/apex/customreport');window.top.close();" /> it is opening one new window and the old window is also there . when the ...
0
votes
1answer
194 views

Validate fields

Consider I have 4 fields. Field 1, Field 2, Field 3, Field 4. Field 3 is displayed(rendered) on the page based on the selections of Field 1 and Field 2. Field 4 is displayed based on some selections ...
1
vote
4answers
3k views

How to reset the form using JavaScript? [closed]

<apex:page id="page1"> <apex:includeScript value="{!URLFOR($Resource.JqueryA, 'js/jquery-1.6.2.min.js')}"/> <apex:includeScript value="{!URLFOR($Resource.JqueryA, 'js/jquery-ui-1.8.16....
1
vote
2answers
114 views

Auto completion correction

I am using auto completion for one of my field <script> var tags1 = {!jsonDescriptionData1}; $( "#autocomplete1" ).autocomplete({ source: function( request, response ) { var ...
1
vote
1answer
384 views

Looking to save selected account records in list using ONCOMPLETE command within a apex:commandbutton

Very straight forward listview table of account records - see apex:pageblocktable below Within this account listview table, we have a checkbox field at the account object as shown in our listview. ...
2
votes
1answer
4k views

Using JS inside VF page to redirect to another VF Page

I have 3 pages, a homepage and then two other pages. Depending on what the user clicks on in the homepage I want to redirect them to one of the two other VF pages. How would I do this using JS or ...
2
votes
3answers
5k views

Hide and show a custom button on a standard detailed page

We have 2 custom buttons on a standard lead detailed page. I would like to show one button and hide another button on page load using javascript by querying the lead and finding a value in one text ...
0
votes
0answers
418 views

error to get values in picklist while loading the page

I have a Picklist(multi seletct) and save Button in a page. when i select some values in that and then click on save button, it is be displaying in a table(selected values with edit link), i have used ...
5
votes
1answer
743 views

How can I truly enable inline editing on Detail tag?

I have a very simple VF page (below) but it does not really support Inline Editing. When I double-click a field that should accept editing (with a pencil icon), the Save/Cancel buttons show up but ...
4
votes
1answer
2k views

jQuery plugin noConflict

I'm trying to use jQery mCustomscrollbar plugin in a VF page. I have the following code - <script type="text/javascript"> $j = jQuery.noConflict(); </script> &...