Questions tagged [onclick]

An event which occurs when user clicked an object. It is a combination of two events, that is, "onmousedown" and "onmouseup".

-3
votes
0answers
19 views

PHP: Run/play the game on button click

I want to display a button that appear on the game page instead of the game itself, when the user click on that button, the game will run and the button disappear. Here is the function of the game ...
-1
votes
1answer
24 views

Change image onclick using javascript

Here's my problem: I am new to Javascript and I am trying to make my image change on click. It's a simple counter game that does a 2 frame animation of squidward hitting the dab. So far I have got ...
-3
votes
0answers
49 views

onclick is Bad Practice, then why is it an HTML5 standard? [on hold]

Continuation of this discussion If onclick/onchange/onsubmit are HTML5 standards, I am sure there is a pattern that fits their usage. I see most sites/apps use the onsubmit functionality of their ...
0
votes
2answers
42 views

JavaScript on click change width by class

If I click a button I can assign it a function like bellow document.getElementById("mySidenav").style.width ="250"; This works fine, however I wish do give it a different width for different ...
2
votes
1answer
30 views

How to combine multiple onclick actions?

I have two sliders on a page, each with their own pagination, is there a way to combine these two onclick actions, so I have a global one which controls both sliders? <a href="#" onClick="(...
0
votes
1answer
12 views

OnClick on model in AFrame-AR.js scene

I am working on an Augmented reality scene using Aframe and ARJS. I am currently rendering obj models when the marker is detected. My requirement is to be able to click on individual models upon ...
-1
votes
2answers
37 views

How to code for Grid Layout onClickListerner

While coding for Grid Layout onClickListerner.. There's error coming in the log report of Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android....
-1
votes
0answers
27 views

data-id returns undefined on ajax loaded content

I have div elements loaded with AJAX, each with a p element with the class open. Using on() to add a click listener to the loaded content, the event does fire but returns undefined. Here's my code: $...
1
vote
1answer
15 views

JSON Dynamic allocation to onclick events by JQUERY

I have following code to add dynamically single JSON value of 'deviceId' to .on("change", function(){ HandleHS100( deviceId , 'off' ); }); Cycle runs twice and it happens that HandleHS100 function ...
0
votes
1answer
48 views

onItemClick ListView Listener not entering the first time

I have a problem in the onCreateView method, I have a fragment which has a button named: variablesButton, every time I click on it, it creates an AlertDialog in which I use the setMultiChoiceItems to ...
-1
votes
2answers
40 views

validate form data before button onclick event

I am really stuck on this one. I have a form which sends an email, to do so the input has to be validated. I got some working method to validate the input, the mail() function also works, same with ...
-1
votes
2answers
92 views

Running Total C#

I'm creating a donation application that reads the input in a textbox, converts it to a double. Then using the method operatingCost, it should take that converted double and divide it by 17% (...
0
votes
2answers
16 views

On click jusmp between array elements JS to show and hide a div

all This code select a random element in the array that will hide/show a div It toggle it. The point is that I need that it always open a new one and hide the previous one with the same button. I ...
-1
votes
3answers
72 views

pass by ref C# button_on_click

I'm creating a donation application that reads the input in a textbox, converts it to a double. Then using the method operatingCost, it should take that converted double and divide it by 17% (...
-1
votes
1answer
46 views

How to convert JavaScript code to jQuery?

symbolen.parent = object; object.element.onclick = function() { this.parent.position.x = 0; this.parent.position.y = 0; this.parent.position.z = 0; this.parent.scale.x = 4, this.parent.scale....
1
vote
2answers
33 views

HTML submit button with forward slash in the onClick

I have a very simple form that uses a forward slash in the input button onClick portion. This is a built in form for an application that we use. The application uses IE to process the form. <BODY ...
0
votes
2answers
54 views

Copying <article> URL to onclick for whole article div with jQuery

I have a list of articles as such: <article> <a class="title" href="http://somelink1.com">Some Link</a> <p>content</p> </article> <article> <a ...
0
votes
1answer
14 views

Two onclick Events with One Button

I have a button like below: <a href="{{ relatedEntry.url }}" data-target="http://go.redirectingat.com/?id=120996X1581244&url={{ affiliateLink|url_encode }}&sref={{ entry.url|url_encode ...
0
votes
0answers
13 views

next and precious button not working after checking more than one validation

I have multiple forms which includes many input field and check box.I have to validate all of them but when ever i try to validate more than two input fields the next and previous button doesnt work. ...
1
vote
3answers
58 views

shortening a URL string programmatically

I have an EditText in my app which users can enter a youtube url. Example url is like following: https://www.youtube.com/watch?v=gXrWv6zlg8s When i grab the text and make it to a string, i only ...
-2
votes
0answers
16 views

JavaScript: distinguish between click or double-click event [duplicate]

I have to event listeners in JavaScript: document.querySelector('#element').addEventListener( 'click', functionA() ); document.querySelector('#element').addEventListener( 'dblclick', ...
0
votes
0answers
19 views

Using jQuery, find the href attribute of a list item when it is clicked

I am using slick slider, every slide is a list item. All of my slide-items have an anchor tag. I would like to be able to click on the "current-slide" (that is the active item) and open the URL in the ...
-2
votes
0answers
24 views

JS, Show always 2 Pictures and load a new one on click [closed]

////UPDATE I try to describe my problem, i hope it's detailed enough to solve it. Thanks in advance for your time. I've got some images: <img alt="Artwork 01" src=".../artwork_01.jpg" ...
0
votes
0answers
34 views

OnClick event and tooltip on a disabled CheckBox button in MFC

Is it possible to capture OnClick event when the CheckBox is disabled and then, to display a tooltip that shows why it is so (based on some business requirements)? I looked up many sources over the ...
0
votes
0answers
29 views

New activity when click on cardview [duplicate]

I am getting problem while coding for a app, I want to open new activity while clicking on the respective card. holder.linearLayout.setOnClickListener(new View.OnClickListener() { @Override ...
0
votes
1answer
16 views

Detect multiple clicks on a field in React JS

I want to navigate to a page on clicking a field(say logo) about 5 times like android developer options. I need to code it in ReactJS. Can someone please suggest ways on how to achieve this.
0
votes
1answer
16 views

Changing multiple images with javascript

I'm trying to set up a page with multiple images (cards from a game) By default, cards start off showing the back. When you click on an image it flips to show you the front. Here is one of the images ...
0
votes
2answers
55 views

My button onClick recenter for OpenLayers doesn't work

I'm building an angular application using openlayers that when I click a button it will recenter my map .I'm trying to re-center my map when I onClick to a button but it doesnt work. ERROR ...
0
votes
2answers
23 views

Open New Link with Card Click (ReactJS)

I am using ReactJS Cards for my program import Card from 'material-ui/Card/Card'; I want to go to a link, for example www.google.com, when I press on the card. How do I do this?
0
votes
2answers
14 views

How to call a function inside another function using jquery onclick event

How to call a function inside another function using jquery onclick event my code is: function function_one() { function function_two() { alert("Activate this ...
-1
votes
0answers
4 views

Javascript image swaping based on condition

i am intended to develop numbers puzzle like,enter image description here Being a beginner i am following idea of image swaping. i have tried following code but its not working. enter image ...
0
votes
0answers
9 views

Graphview y axis problem when generated inside OnClick

So when I generate the graph inside the onCreate I get exactly the graph I want Correct Graph But when I try to generate the Graph after clicking a button I get this Incorrect Graph I am trying to ...
0
votes
1answer
33 views

ruby on rails call javascript function from button_tag

I am very new to Ruby on Rails. I realize there are plenty of build-in staff i.e. scaffolding etc. But in a mean time I am trying to perform very simple task in: Button is clicked - message is ...
-1
votes
2answers
27 views

button onclick document instead using in JavaScript file

I have some issue which i need to write in js file instead of button on-click someone help me please. I written some code but its not working properly. Thanks document.getElementById("box1")....
0
votes
1answer
25 views

Get reference to a function to execute from the unity inspector for OnClick of a dynamically instantiated Button

I want to know how I can get a reference to a particular function on any another script through the unity inspector for adding it to a on-click listener of a dynamically instantiated button. I tried a ...
1
vote
0answers
17 views

onclick function is not functioning properly

Apparently my code looks fine to me, i have already run one such example, but these onclick() functions are not performing their job no matter what. Can anybody please help me out with that? Its just ...
0
votes
0answers
9 views

Adding a separate Click Event onto a TreeNode?

I have a Treeview Control in my ASP.Net Web Form that I populate from code behind and add images to corresponding Nodes. I built an event for when a user clicks on one of the ChildNodes that ...
-3
votes
0answers
17 views

document.getElementById inside in another function [duplicate]

i have a button and try to get values from different 2 inputs when button is clicked, how can i get "document.getElementById('inputA').value" into another function? Thank you for replies onclick="...
-1
votes
0answers
10 views

How can I make onclick button work with emails

How can I make onclick button work with emails. The script I am trying to use is written below <form> <input type="button" value="Purchase" onclick="window.location.href='amazon.com'"; /> ...
0
votes
1answer
19 views

fill iframe input field from click on parent

I have an iframe containing a form. On the parent page, I have an interactive div which populates data on mouse clicks (map.) Is there a way where I can fill an input field that is part of the iframe ...
0
votes
0answers
10 views

changing grid images on click

I have 3*3 grid and i have a slider that should change the images on click based on the selected project i made an object with every project and its images like so : const projects = { cancellato: [ ...
1
vote
4answers
36 views

Javascript delay a mousedown event

I'm trying to make the following code work: document.onmousedown = function(e){ setTimeout(function(){ e }, 3000); }; This is just pseudo code, but I want to capture the mousedown event and fire ...
-1
votes
0answers
44 views

How can I add onclick funtion to <a link in php echo? [duplicate]

I am trying to make a confirm button before someone can delete a user. But I am running in to a problem... With my current code I am getting the following error: Parse error: syntax error, ...
-3
votes
4answers
59 views

How to open different activities with Recycle view items using on click listeners

How to open different activities with Recycle view items using on click listeners.Help me i am the beginner. my code is Main Activity:
0
votes
0answers
36 views

d3 on click event listener failing in Leaflet

What should be a fairly straightforward thing is giving me some trouble in Leaflet. I have d3 points overlaid on a Leaflet map: // create map element in DOM <div id="map" class="sf" style="width: ...
0
votes
1answer
37 views

Get specific div when clicking button in php while loop

I have a while loop spitting out multiple post which each has a div button called 'flag_btn', when clicked I am trying to show the corresponding div container for my form all being displayed from a ...
0
votes
1answer
27 views

JQuery toggle for multiple class element on click combining

as you can see. There are 3 show hide toggle on click. <button id="btn-hide" class="btn-toggle">Hide</button> <button id="btn-show" class="btn-toggle">Show</button> <...
0
votes
0answers
18 views

How can I duplicate a button to scroll to a second option in page using jQuery?

I have a button that when clicked, presents two forms in the page below (one above the other). Once the button is clicked, the page scrolls slightly down to present option number 1 at the top. I'd ...
0
votes
2answers
28 views

Javascript Click function with jquery table

I am new javascript. I have a table in my table in html. And I change the information inside the table using ajax function. This is my html table. <table class="table table-striped" id="itemData"&...
0
votes
1answer
25 views

Inserting multiple ID's into a SQL Table from a grid view which allows multiple check boxes to be selected

I have a grid view which I allow the user to select multiple lines via a check box, from the selected lines I want to insert a dataid into a database table. I have used a foreach on the aspx section ...