We’re rewarding the question askers & reputations are being recalculated! Read more.

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
-3
votes
1answer
545 views

Visualization chart not being displayed

I'm using the code below but it is no showing any chart, is there an obvious reason why? < script type="text/javascript" src="http://google.com/jsapi"></script> <script src="/...
0
votes
2answers
4k views

How can I redirect the page to navigate to a new record (Case) that was created with a custom button?

I have a custom Javascript button on Opportunity Layout that executes a method that creates a case. After the alert says "Case Created" and User clicked OK, I want the page to redirect to the Case ...
4
votes
1answer
3k views

Manage (and re-use) apex:pageMessages from Javascript

I would like to know if is possible to set and show a apex:pageMessages block from javascript I've been trying to do something like this: VF page: ... <apex:pageMessages id="jserror"/> ... &...
2
votes
2answers
3k views

Setting color for multiselect picklist

EDIT:Sorry for not specifying this critical part. I want this to be done on a Multi select picklist on standard salesforce *(even if it means hacking the side row by adding a dummy component) and not ...
-1
votes
1answer
10k views

HTML5 FileReader API & IE Support (reader.readAsBinaryString) [closed]

I have trouble reading the Uploaded File (XLSX) via FileReader API's "readAsBinaryString" method in IE10. "readAsText" method works fine. Has anyone come across this, does IE support this method? Am I ...
4
votes
2answers
9k views

Call apex method and JavaScript from html button

I have a custom search page for use in Customer Portal. VF Page: <form name="frmSearch"> <input type="text" name="keyword" id="keyword" value="{!portalSearchModel.searchTerm}" ...
3
votes
0answers
2k views

XLS Read and Automatic CSV conversion

We have a requirement to read contents (rows) from an XLS file and upload (the file as an attachment) the same once the read and insert into custom Objects are complete. My observation after ...
6
votes
2answers
2k views

Is <apex:includescript> cumulative?

If I have two components (on a single page) that both reference the same JavaScript Static Resource using an <apex:includescript> tag, will the script be included twice?
2
votes
1answer
1k views

Does $Action.New not prompt the user to select Record Type?

I have Task object with few record types. I created a custom List button on the task object and placed it on the related list of few objects. When i click this button i expected that it would prompt ...
4
votes
3answers
6k views

How to hide a apex:pageBlockSectionItem by Javascript

I'm hiding a field row (apex:pageBlockSectionItem) using the next code: VF: <apex:pageBlockSectionItem > <apex:outputLabel value="My nice field" for="myField"/> <apex:...
3
votes
2answers
6k views

Refresh the page on complete of execution

I have a detail page button which calls a webservice class. Its some thing like: sforce.apex.execute(Class, method, {paramName : Param}, { onSuccess: success, onFailure : failure}); I need to ...
-1
votes
1answer
2k views

Jquery event handler does not fire after Visualforce table refresh

I am using the Datatables library together with visualforce to create a funky table but I am having "funky" issues to get it running properly. Basically I have a button that will query the Salesforce ...
-2
votes
3answers
4k views

need to display selected Values through javascript

My VF page is something like this <apex:page standardController="Temporary_Contact__c" extensions="tempView" > <apex:includeScript value="{!URLFOR($Resource.jquery)}"/> <script ...
4
votes
2answers
2k views

Need help text of more than 255 characters

I need to use helptext with one custom field in Visualforce but Salesforce it allows 255 characters in helptext with a field. One solution is to create an image of text and show that image onMouseOver....
11
votes
2answers
3k views

Funny behavior with components, javascript, and rerender

Has anyone else seen something like this? 1) Create a component that includes a javascript block (OK, the code is overkill, but pretend it's actually doing something): <apex:component layout="...
18
votes
1answer
2k views

Is there a security risk with JavaScript Remoting, escape = false

Initially I thought the answer to this question was yes, so malicious JavaScript cannot be injected into the page if it is in the response. Yet upon a further look at this question it is a lot harder ...
0
votes
1answer
1k views

Comparing dates using javaScript

I am try to write a validation rule using javaScript. Date range should not be greater than 90 days.In order to do that,I have created two date fields and directly access in Visualforce page and the ...
2
votes
1answer
213 views

JS remoting question

I am a newbie to SF. We have a spring MVC application. The controller returns the result as JSON object. My task is to call that controller method using JS remoting and display the results in ...
2
votes
2answers
4k views

Issue with passing parameters in Service Cloud Console Integration Toolkit

i am currently having certain hyperlinks in VF page which i need to make compatible in service cloud and hence using the API toolkit.I am quite new to callback methods, what is the syntax to pass ...
4
votes
1answer
4k views

Use of (BlockUI) plugin in jquery constantly breaks Visualforce pages

ADDED DETAILS: The problem appears only on those VF pages where a custom homepage component uses another version of jQuery. Those component seems to load later and overwrite the jQuery object that was ...
8
votes
2answers
8k views

How should I properly format a Date within an SObject parameter to a RemoteAction method?

I'm having trouble sending Date values from the client with remoted methods. If my RemoteAction method takes a plain Date value, everything works fine with the suggestion of using "toUTCString" which ...
4
votes
2answers
3k views

Load and execute Javascript on the fly (Stored in static resources some other place) with SFDC Buttons on layout

Use Case - There is Javascript execute button on Account page layout named 'Update Account' - {!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")} //...
5
votes
1answer
273 views

Is there away to pull a users standard layout in edit mode and place it on a VF page?

I know there's a ways to do this using tag to view the detail page, but once you hit edit it will use salesforce standard edit page. I've also created a custom edit page but the problem I'm running ...
2
votes
4answers
2k views

Reading a csv file(document) in Jquery

We have a requirement where we want to read a csv document in Jquery / Javascript. We are able to read the file from documents (via query) and Static Resource inside the controller and then pass it ...
2
votes
2answers
3k views

Populate lookup field on Object after Clicking a custom button and creating record on different object

I would like to create a custom button on service contract to create an opportunity. I want to populate a lookup field between service contract and opportunity (So I will be able to use it for some ...
4
votes
1answer
218 views

Is using a class a good option for creating a new Object and how could I send an error string to javascript?

Thank you for taking the time to look into my question, this is my first Apex/Salesforce project, I am familiar with Java and javascript. I have been tasked to creating a new Object called 'Service ...
4
votes
1answer
699 views

Visualforce Remoting and Relationships

Question Is it possible to leverage relationships with Visualforce remoting, including one object as a property of another? Background I've been playing around but always seem to get a VF remoting ...
1
vote
2answers
4k views

onmouseout Event after clicking on link

Here after clicking on the link onmouseout event should be called.I'm very poor in Javascript & need help in this Required something like this when I enter into the block of reporting,& ...
-4
votes
2answers
1k views

Checkbox field popup

I have a checkbox field, and i want if user checks that field then it should ask are you sure,if press ok then it should continue otherwise not?
3
votes
2answers
594 views

Lookup displaying JavaScript error (Internet Explorer)

One of our user is receiving a JS alert when filling a lookup (from a custom object). error: { faultcode: 'soapenv:Client', faultstring: 'Attribute "xmlns" bound to namespace "http://www.w3....
2
votes
1answer
1k views

What fires the activity reminder pop-ups in Salesforce?

Is it tied to a page load? If so, which pages? Or some other element inside the page? Sidebar maybe? Is it possible for a packaged app to interfere with the reminder pop-up function? I'm trying to ...
2
votes
1answer
1k views

VisualForce Page Set URL Parameter w/ Javascript

I have a custom search VisualForce page. I have an inputText area for a search term, upon hitting enter I wan't to pass that value to URL parameter. Trying to do it via JavaScript. I want URL to be ...
0
votes
1answer
316 views

chatterfeed toggle not working post Spring '13

in my application I created a Javascript(posted below) to show and hide chatter feeds in the home page which was working fine till winter release.But post Spring '13 release the chatter toggle ...
1
vote
3answers
8k views

Disable custom button on detail page on some condition..?

I have custom button on standard detail page...I want to disable that button/gray out if my status picklist value is "Approved". Java script on button click var newRecords = []; var o = new sforce....
0
votes
2answers
2k views

javascript for changing outputlabel whenever input value is changed

I have a input field with date date = 1/16/2013 (in the form of inputtext) whenever I change this input text their is an another output text where this value should reflect date1 = 1/16/2013 (in ...
4
votes
2answers
823 views

Does customer portal support ajax?

For example, i have a simple JS button which returns the username of the logged in user. {!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} var name= sforce.connection.getUserInfo(); alert( name....
2
votes
1answer
2k views

Get IDs of checked/ticked records, from list view, in Customer Portal

My custom button works in normal Salesforce UI, but not working in Customer Portal. OnClick JavaScript: var contactIds = {!GETRECORDIDS($ObjectType.Contact)}; if (contactIds.length != 2) { ...
7
votes
2answers
6k views

Decoding HTML String built in the controller

Using JS Remoting I want to generate HTML content in the backend and then display it in the VF page. I am building the string in the controller as per follows: String account = [SELECT Id, Name FROM ...
1
vote
1answer
1k views

How to access pageblock item in Javascript?

<script> var ele=document.getElementById('{!$Component.product_form.product_pageblock.product_section2.Search_Keyword}'); alert('Ele = ' + ele); </script> <apex:form id="...
8
votes
1answer
2k views

Remote Actions and Session Timeout Question

We have a visualforce page that serves as a somewhat live dashboard for information in our salesforce instance. Through javascript and Javascript remoting (remote actions), we are polling salesforce ...
5
votes
4answers
4k views

What is the best way to manage javascript resources for Visualforce pages?

So at the moment when I want to make a quick tweak in a javascript file that enhances a Visualforce page, I have to go: Setup >> Development >> Static Resources Find my script in the list (takes a ...
2
votes
1answer
904 views

What is “ListViewport” and where is it documented?

What is "ListViewport"? I saw that some users use this object. And I can only guess that it is a JavaScript object. But I have found no official description for it. Any ideas? Example from the stack ...
4
votes
5answers
5k views

Cannot get the global variable $Component to return id

How can I get the force.com generated id from the $Component global varible for me apex:selectRadio component? Javascript var rdo = j("input[@id=" + jq('{!$Component.searchRdo}') + "]:checked").val()...
1
vote
1answer
2k views

How to get the updated values after an APEX call from Javascript

I am currently calling an APEX method (in a controller) with variables from Javascript. I would like to reflect the changes made in the controller in the page. I am using an apex:actionFunction to ...
2
votes
1answer
3k views

List View Custom Button to Collect Values of Selected Records

I want to create a JavaScript button to use on list views that when clicked captures a list of the values of a field on all the selected records. GETRECORDIDS returns a set of IDs of selected records. ...
1
vote
1answer
567 views

Passing disbaled input fields values to apex controller

I have a JavaScript function that fills some apex:inputfields and make them disabled so the user cannot change their values. But it seems that values aren't passed to the controller after an action (...
3
votes
1answer
2k views

How to fetch namespace prefix and salesforce instance using javascript?

i am using Custom button & links in List view of Object and on click of button i am executing javascript to redirected to new page and its works fine in my DE but when i install that package in ...
1
vote
2answers
852 views

Use static resource in Javascript/Google Maps

Anyone know if its possible to use static resources to store the marker image for a VF/Google maps combo, e.g. loading the icon below. marker = new google.maps.Marker({position: latlng, map: map, ...
0
votes
1answer
2k views

Naviagate to Previous Page or Close the Window

I am creating a Cancel button for force.com site page. This page is a part of a managed package. I am looking for javascript for this button which can work in two different way. It means, if any user ...
2
votes
3answers
4k views

apex variables used in javascript of VF is not getting updated with latest values

i am currently using a inline VF page to perform an update on an Sobject. The inline Vf page a picklist field and a button which will update the sobject with the values entered in the picklist. Now, ...