Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [onclick]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Lightning icon inside a tag not working properly

I have used html table to show list of records with custom pagination and sorting in lwc component. For sorting, I need to have up and down button along with text on headers.(Clicking on header text ...
user avatar
0 votes
0 answers
489 views

Onclick row in Datatable LWC

Hi guys :) I am new in programming and salesforce. I want to get to the apex and take a name of click company can you tell me what schould I wite in field message = 'NAME OF CLICK COMPANY';. When i am ...
user avatar
  • 13
0 votes
1 answer
22 views

Button showing/hiding parametr LWC [closed]

Hi :) I am new in programming and salesforce. and now i have a problem with buttons. I want to one click it and show a param from js (data). (company.date schould show just when I will click button) ...
user avatar
  • 13
0 votes
2 answers
120 views

LWC Component failed to display

Hi I am new to both coding and LWC, just trying to create a simple component that displays a table of order items in two columns. I want to display only first three items then display a "Show ...
user avatar
0 votes
0 answers
40 views

How to make a column in lighting datable call JavaScript function?

How to make a column in lighting datable call JavaScript function? This column has to be editable at the same time. Something like in the picture below - but when clicked the account name has to call ...
user avatar
0 votes
0 answers
54 views

Click Button Automatically in LWC from CSS class Id

I have a markup code in community which has the button and want to hit the button from LWC component. When I am doing it , it says :Error during LWC component connect phase: [p.click is not a ...
user avatar
  • 1
1 vote
1 answer
437 views

How can I get the nearest data-id of the clicked element? [duplicate]

On an html page, I want to dynamically draw elements and I want to determine the data-id the nearest element li that contains the clicked element a, and then add a class to the element with the li ...
user avatar
0 votes
1 answer
246 views

Update value in object field checkbox by clicking custom button [closed]

I want to know how to update check box object field. Currently the check box by default the value is uncheck(false). But I want when user click yes button, the check box object field(yellow ...
user avatar
  • 23
0 votes
1 answer
150 views

How to open a new form on top of the current one when clicking the button? [closed]

I have a "new" button in my aura component (lightning: button). When I click on this button, I want to open a new form ("New Contact") on top of the current form, in which I need ...
user avatar
2 votes
0 answers
605 views

Close Toast Message with messageData on hyperlink click - lwc

I have a toast message in lwc that uses sticky mode (does not go away until the user click on close symbol) and also messageData (to add a hyperlink in the toast for the user to click on). The thing ...
user avatar
  • 53
0 votes
1 answer
785 views

Auto focus to first cell of empty row in lightning datatable when new is clicked

I have a Add button and a lightning datatable. When I click on add button I want to add a row to datatable. Now, Instead of showing a popup (after clicking add btn) I want to show an empty row and ...
user avatar
  • 355
0 votes
1 answer
969 views

SSJS onClick function in Marketing Cloud

I'd like to use the onClick Event on the a element in Marketing Cloud to create a new field in a data extensions when clicked and later fill out this field with a letter A. For now I focused on ...
user avatar
0 votes
1 answer
505 views

Is it possible to put a validation rule on a formula field that is a hyperlink?

I have a formula field that has a few conditionals with a hyperlink as a potential outcome. I want to put a validation rule on the formula field that doesn't allow the user to click the hyperlink ...
user avatar
  • 3,177
0 votes
1 answer
330 views

Apex command button action executes even if the onclick button returns false

I have a situation where I need to open up a confirmation dialog as in the image, on the click of Save Update button. The button needs to check the value of the checkbox, if checked,only then open ...
user avatar
0 votes
1 answer
364 views

Button icon with possibility of passing parameters and get element

I have a IconButton , but to pass parameters to the JS, I use regular Icon with span like this : <span onclick="{!c.copyLink}" data-theurl="{!item.path}" data-caseid="{!item.id}" > <...
user avatar
  • 423
1 vote
0 answers
136 views

window onclick listener not working properly

I have created a custom lightning web component that, if an specific div is found on the template and you're clicking outside of it, it must close the current div constructor(){ super(); ...
user avatar
  • 771
0 votes
1 answer
1k views

press and hold mouse event in LWC

I have a below button in LWC HTML: <lightning-button-icon icon-name="utility:chevronright" onmousedown={slideRight} variant="bare"> JS: slideRight() { this.template....
user avatar
  • 2,225
1 vote
1 answer
469 views

Nested lightning:button onClick Not Firing

When I have a button inside a component inside a lightning:card either as a body element or an action, the onClick is never fired. If I move the lightning:button outside of the container, the event ...
user avatar
  • 115
0 votes
0 answers
532 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 ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
2 votes
1 answer
1k 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" ...
user avatar
  • 497
0 votes
2 answers
273 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 ...
user avatar
  • 21
0 votes
1 answer
642 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 ...
user avatar
  • 21
1 vote
0 answers
557 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 ...
user avatar
  • 149
0 votes
1 answer
138 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('...
user avatar
  • 21
0 votes
0 answers
489 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 ...
user avatar
  • 1,436
2 votes
0 answers
434 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,...
user avatar
  • 1,298
0 votes
0 answers
661 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 ...
user avatar
0 votes
2 answers
1k 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 ...
user avatar
  • 1
1 vote
2 answers
3k 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 ...
user avatar
  • 313
0 votes
1 answer
3k 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 <...
user avatar
0 votes
1 answer
175 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), '...
user avatar
2 votes
1 answer
62 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 "...
user avatar
2 votes
2 answers
4k 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 ...
user avatar
0 votes
0 answers
1k 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(...
user avatar
  • 1,490
2 votes
1 answer
2k 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 ...
user avatar
0 votes
2 answers
3k 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 ...
user avatar
  • 121
0 votes
1 answer
270 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 ...
user avatar
  • 1
0 votes
1 answer
1k 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 ...
user avatar
  • 822
0 votes
2 answers
93 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 ...
user avatar
  • 64
1 vote
1 answer
1k 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 ...
user avatar
  • 4,521
1 vote
1 answer
3k 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:...
user avatar
  • 4,521
2 votes
1 answer
3k 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 ...
user avatar
1 vote
2 answers
360 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 ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
0 votes
2 answers
143 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 = ...
user avatar
1 vote
2 answers
7k 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 ...
user avatar
0 votes
1 answer
58 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 ...
user avatar
  • 802
1 vote
2 answers
3k 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....
user avatar
  • 413
0 votes
1 answer
573 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 ...
user avatar
  • 1,431