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

Questions tagged [onclick]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
31 views

Why .addEventListener(“click” doesnt work on mobile but works on computer?

I have an LWC that works perfect in computers but doesnt work on mobile Devices marker.addEventListener("click", function(e){ // Centra la pantalla al marker seleccionado ...
0
votes
0answers
16 views

Can I customize the warning message for On click event on Cancel button

I have created an onclick event on the cancel button in my visualforce page and it works as expected. I want to change the wording for OK and Cancel button to Yes, Proceed and No, Stay.Is it possible. ...
0
votes
0answers
13 views

How to display the Failed Records Name in JavaScript Listview Button

I am using Onclick JavaScript List view button to update the multiple records. How to display the Failed records name along with the message in the below. I tried many ways could n't acheive it. Can ...
0
votes
1answer
201 views

Refresh lightning:tab on change

I Built a lightning component which is used in opportunity layout. This component used some child component as lightning tab. The problem is when I edit and change some value in first tab is not ...
2
votes
1answer
48 views

Getting error function not defined while it's there

I need to call the jsPdf function, however in the console I am getting genPdf is not defined. Here is my code-- <apex:page controller="GenerateQuoteController" standardStylesheets="false" ...
0
votes
2answers
51 views

Passing argument to onclick event

I am dynamically creating HTML <div> and I need to handle the onclick event : when the user clicks on it, I want to call a controller function and this function requires an argument. How do I ...
0
votes
1answer
107 views

Dynamic DOM : firing event on click

I am dynamically creating some DOM elements inside my component's controller and adding them to the page. I need to set the onclick event on these elements to call another controller function that ...
0
votes
0answers
412 views

Dynamically created HTML : link onclick to Controller function

I'm creating some HTML elements in a helper function, and dynamically appending them to the DOM. There is no problem in this step. The only problem I can't solve is the creation of the onlick ...
1
vote
0answers
192 views

Get event source from onclick handler in outer div

In my lightning components, I am trying to create a system that keeps track of every button that gets clicked inside my component. Having an event that fires whenever any button is clicked turns out ...
0
votes
1answer
112 views

Reference a controller function for a dynamically created DOM element

In my helper, I have a function that is dynamically creating multiple . I want the onclick event to trigger a controller function : I tried the following code : accordionWholeDiv.setAttribute('...
0
votes
0answers
395 views

Lightning component navigatetoURL to open Lightning App Page

Using Aura:component with figure onclick to open URL which is another Lightning App Page. Cannot get the URL syntax correct. It's a managed package so will have different MyDomains. The Lightning App ...
0
votes
2answers
609 views

event.target.value returns [object object] on onClick

component pseudo code <aura:iteration var="PIW" items="{!v.objInfo}"> <thead> <tr> <th> <button ...
2
votes
0answers
280 views

New button pop is not showing to create new record in Lightning

i am new to lightning and trying to learn lightning. i have created component in that component i am showing the contact based on the accountid using (implements="flexipage:availableForRecordHome,...
0
votes
0answers
439 views

onclick event not working on dynamically created <li>

I have a component where upon aura:iteration (data loaded from server onInit), other components are created (list items of an SLDS lookup). The issue I have is, the onclick on the LI does not fire ...
0
votes
2answers
559 views

Onclick javascript button - how to enable and disable based on profiles

Onclick javascript button - how to enable and disable based on profiles. For example the button should be displayed based on no of days created , if more than five weeks the button should be visible ...
1
vote
1answer
2k views

Aura Iterate, get the aura:id of a span

I'm trying to get the ID of an element that is in a loop to trigger an event, but I can't get the ID nor content of the tag. I've done something similar on visual force pages, but I did it ...
0
votes
1answer
2k views

Lightning OnClick Not Working Within aura:iteration

I've been unable to get onclick actions to work in my organization when the onclick element is within an html <aura:iteration> tag. The onclick action works when I put the <a> tag or <...
0
votes
1answer
79 views

Nested IF statements on a button's onClick

I am working on a custom Visualforce page where I have requirement for a button to function based on a criteria. This working good: <apex:customButton onclick="{!IF(OR(c.first, c.second), '...
2
votes
1answer
35 views

OnClick Javascript button error when merge field value is “St. John's”

I'm working with a Detail Page Button that executes OnClick Javascript. Most of the time it works just fine. However, in this particular instance, one of the merge fields in the script has a value of "...
2
votes
2answers
2k views

Action failed: lightning:button$controller$handleClick [d.run is not a function]

I have a lightning component called modal which is used in another component called Split, the modal takes an array of buttons to render them (and does some more) I have a working version of it in ...
0
votes
0answers
425 views

<input type=“radio” returning ON with onclick function

To my previous Question, I did some more debugging and ended up log with OnClick value: on Good thing is, I have my LightningApp on the Internet Explorer which helped to get to the console logs(...
2
votes
1answer
1k views

OnClick JavaScript Button, Invalid or unexpected token error

Here is the field I am trying to update, the far left is the picklist I am wanting to update. the field on the left is another picklist. both lists have the same values. As you can see below I have ...
0
votes
2answers
2k views

lightning dynamic component datatable onclick/onrowselection

I have a lightning component that dynamically creates a lightning:datatable when apex returns a list of records. For the most part its working, but im trying to add an onclick event to the row, but ...
0
votes
1answer
196 views

If Condition for onclick not working

I am looking for a way to insert a record and close the window with the VF-Page, when everything was entered correctly and user clicks button. The values are entered correctly, if a subject was ...
0
votes
1answer
785 views

Update controller variable from visualforce button/div onclick

I am having issues with my visualforce page refreshing everytime I perform an onclick action? Any ideas public without sharing class LMS_CaseNewEditController { public Boolean recordClicked ...
0
votes
2answers
67 views

onclick Javascript failing to pass If Condition

What could be wrong with this code? I'm fairly new to javascript and I've been trying to debug on my own to no avail. The alert('confirmed: ' + records[i].ENQ_Confirmed_with_Enbridge__c); shows ...
1
vote
1answer
667 views

Making a checkbox field value null using a JS function

I am trying to set the value of a checkbox(custom field) to null in a VF page using Javascript function.Below are bits and pieces of my code. This happens when the user clicks the tag. An Onclick JS ...
1
vote
1answer
2k views

Cannot read property 'value' of null in this case

I am trying to get the value of a text field in a VF page in Java Script. Below is my VF page. <apex:page id="thepage" standardController="Opportunity" extensions="OpportunityExt"> <apex:...
2
votes
1answer
2k views

CommandButton oncomplete JS function not firing [duplicate]

I have run into an issue with an apex:command button, where the oncomplete part of the process is not being called, and prevents the button from completing its action. The VF page is a component on a ...
1
vote
2answers
248 views

Call Record's JS onclick button from a VF page

I have created a custom button on a record that calls onClick JS to update the record. I would like to call the same JS button's function, from a VisualForce page. The purpose for this is so that I ...
0
votes
1answer
556 views

Updating a record, and related record using a custom button

I am trying to build an onClick JS button on a custom Object called Application. The button is designed to update 2 fields on the the Application, and a related record's field on the Opportunity ...
0
votes
2answers
107 views

Invalid left hand side in custom Javascript

I'm trying to edit a custom OnClick JS button which creates a PDF from a quote, provided the quote passes certain checks. this code works: {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var q = ...
1
vote
2answers
3k views

Adding onclick to dynamically created button

I have a component that dynamically creates buttons which, when clicked, apply filters and then re-query the back end for data. While I can assign onclick events to each button, I can't find a way to ...
0
votes
1answer
35 views

How can I reference an installed pkg VF page in an OnClick Javascript Detail Button

I need to update this hardcoded url before an instance refresh and I am having difficulties finding a solution. The VF page is from a managed package that has the namespace of scl I have tried to ...
1
vote
2answers
1k views

How to pass map<string,string> as parameter in javascript

I have a method : webservice static String myMethod(String objectType, String recordId, Map<String,String> fieldValueMap ) I need to pass this in onclick javascript custom button. sforce.apex....
0
votes
1answer
297 views

value outside of valid range on numeric field: NaN

I want to track how many times a user clicks on a certain button called Reject. So I created a counter field that will be updated whenever the Reject button is clicked. The counter I created is called ...
0
votes
1answer
189 views

how to show my selected pick list value using on click function?

i have one VF page in that i have one Pick list value while clicking next button it should show my selected pick list value like You have rated location name good/average/low/excellent". Here is my ...
0
votes
1answer
342 views

Button: How to Add a Number value to SF number field

Goal: A user should expect to increment a custom object's (number type) field by 1 each time the custom button is clicked. Initial block: {!REQUIRESCRIPT("/soap/ajax/37.0/connection.js")} ...
0
votes
1answer
782 views

“sforce.connection.insert is not a function” error

I am creating a button which creates new record in another object, i am using following javascript code var curnc= new sforce.SObject("TR_Currency_Approval__c"); curnc.Name="{!TR_Currency__c.Name}";...
0
votes
1answer
168 views

onClick Exectue Java script for SF button error Invalid or Unexpected Token

Here is my code in the button: if({!NOT(ISPICKVAL(SVMXC__Service_Order__c.SVMXC__Order_Status__c, "Closed"))}){ alert("Close Work Order button has not been completed, the Work Order Order Status ...
2
votes
2answers
10k views

Using action and onclick together on command button

I have to call an apex function only when javascript validation passes. Hence,initially I tried the below code: <apex:commandButton value="Submit" onclick="return addDomain();" action="{!...
1
vote
1answer
124 views

On-Click Button: Why is Salesforce passing in 'undefined' string value?

I am trying to auto-insert an array of Tasks based on the Accounts selected in the Account 'List View' tab. The tasks are inserting as expected, but instead of writing the Account Name in the subject ...
2
votes
2answers
638 views

How to get all buttons in my page from a controller javascript function(component, event, helper)?

I know how to enable the clicked button. Lets say I want to enable all buttons on the click of a button. The button is in a Lightning component as: <aura:component implements="flexipage:...
0
votes
3answers
96 views

Onclick Javascript fails identify Resultset

I have below code where I get a run-time error as 'Unexpected Identifier'. My Resultset is not getting evaulated properly. Can someone please help? Onclick Javascript code in Detail Page button {!...
0
votes
1answer
718 views

If statement fails in Onclick javascript button

I have below code where if statement that needs to work based on 'check' boolean value, is not working properly. Although, 'check' value is true it navigates to the else block. Can someone please let ...
0
votes
0answers
274 views

Added Onclick Java Script Alert into Detail Page Button

I am encountering some issues and it has me stumped, and hoping the community can help me out. The aim here is that when the user pushes the custom button an alert should pop up saying: "By ...
0
votes
2answers
341 views

OnClick Java Script - reload child records

I have a detail page button that is currently calling an APEX class. After the class has executed I am reloading the page that the button was clicked on. Is there anyway to also reload related lists/...
0
votes
1answer
881 views

Uncaught ReferenceError: callAF is not defined

I am trying to update the checkbox(checked or unchecked) in the database from the UI. I am calling the js function on onclick of checkbox and invoking controllers action but I am getting this error. ...
3
votes
1answer
91 views

How to detect showListButton/hideListButton being clicked on collapsible PageBlockSection?

I'll go through it in text, but here is a short video detailing my problem: video Hi, in this sample code I have collapsible PageBlockSections which are collapsed by default. Currently, when a ...
6
votes
1answer
801 views

Possible to call a javascript and action function from click

I want to call a Javascript function as well as issue a backend call at the moment a button is clicked. This is my code right now : <apex:commandButton value="Search" action="{!objectCollection}...