14,650 questions
2
votes
1
answer
104
views
Poem Generator (JS)
I'm trying to make a random poem generator where, when the necessary inputs are made a topic id first created (consisting of the name of girl and name of country) then the poem which also has the name ...
3
votes
2
answers
67
views
Why does this collapsible need 2 clicks to open, then 2 more clicks to close?
Description
I'm having an issue with a collapsible requiring 2 clicks of a button to open, then another 2 clicks to close. The Show/Hide text inside the button gets mixed up as well. I think it might ...
-3
votes
1
answer
78
views
button onClick not working in React JS when trying to show inputs and buttons [closed]
I was just building a new React App while using bootstrap and react router. I have done it many times. I wanted to show a search input and button for my code. There would be two search inputs and ...
-2
votes
1
answer
120
views
Delay issues with onClick using data from useEffect
I'm making a small flight tracker system and I'm encountering an issue. Here's the code for a "choose your flight" page:
"use client"
interface MyPageProps {
searchParams: ...
0
votes
0
answers
51
views
jquery stop scroll on setTimeout click function
I'm setting a click function to open a tab but on click it scrolls the page down which I don't want to happen. How can I stop the scroll?
$(window).bind("load", function() {
if ($('.feefo-...
-1
votes
1
answer
142
views
Extracting elements of an OnClick function to modify it at runtime [closed]
Is this the best way to modify certain links in my webpage to add search parameters? Are there better ways?
I do not want to do it by Sessions variables, because I am going to another subdomain of my ...
-1
votes
1
answer
152
views
Results from AJAX/PHP call aren't showing when Submit button clicked [closed]
I'm struggling to figure out why my results data isn't showing on my webpage from the AJAX/PHP call. I'm pretty sure it's something to do with the coding in the HTML and the way I am trying to pull ...
0
votes
0
answers
69
views
Code fullscreen element responsive by clicking fullscreen button? Simulate a mouse click?
I'm trying to get fullscreen for iframe element immediately responsive to user input (e.g., keyboard input) without having to manually click when fullscreen to get the fullscreen responsive (think of ...
1
vote
1
answer
76
views
Storing mouse click event coordinates of graph with matplotlib
I am attempting to store coordinates from two mouse clicks in an interactive matplotlib graph in JupyterLab. I have managed to interact with the plot and get the x and y coordinates to print upon ...
1
vote
3
answers
75
views
Function in external file doesn't run when button is pressed despite being bound in onclick in HTML/JS
When I run this, it doesn't run the function when I click the button, however it is run once when the website is loaded/reloaded even though (as far as I can tell) the code doesn't do that at any ...
1
vote
2
answers
526
views
Interactivity not working in Blazor Server .NET 9
I need some help. This is the first time I'm building a Blazor app and I've been trying to get an @onclick working on a button in my .NET 9 Blazor Server app and I just can't get it to work.
I've ...
2
votes
1
answer
63
views
How to limit matplotlib button_press_event to a single axis?
This script:
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
def fAccept(_):
print(f'accepted')
def onclick(event):
print(f'click {event.xdata, event.ydata}')
fig, ax = ...
1
vote
1
answer
68
views
I'm learning AJAX and I need to write a function to send to PHP script an argument from onclick JS event and first button click do nothing [duplicate]
HTML file:
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
...
0
votes
0
answers
41
views
How to make a transparent scrollable layer pass click events to the layer below in Jetpack Compose?
I'm working on a Jetpack Compose layout where I have three layers:
A blue Box at the bottom that is clickable.
A transparent full-screen Box on top of it that should allow vertical scrolling (using ...
0
votes
4
answers
150
views
Button color-change on click, in React
I am trying to have a button to change its color when clicked in React.
I found this and tested it: https://reactgo.com/react-change-button-color-onclick/
The code being:
const [active, setActive] = ...
1
vote
1
answer
69
views
How to display 3 elements by 3 of an array in HTML using array.sclice() method in javascript
I have found a way to display a portion of an array using arrayName.slice(start, end), i made a funtion to feed the start and end to the slice method so i can use it with onClick button to click next ...
2
votes
1
answer
224
views
Drag and Drop Elements Independently in Vanilla JS
I'm new to Javascript, but getting close to finishing the vanilla JS for a mock desktop UI project: opening asides as "windows" that can be reordered, selected, and moved independently ...
0
votes
0
answers
47
views
button Element doesn't work on Iphones for some reason
I have tried to make something for Math class, however the button elements didn't seem to do anything on Iphones. I have tried to use eventlisteners and the onclick Attribute.
Does anyone know why it ...
1
vote
1
answer
57
views
Image alt captions showing as 'undefined' on modal image
I have mutiple art galleries on my website containing lots of images, I use an onclick event to pull up a full res, uncropped version of the image and it works perfectly fine. However, I want a unique ...
1
vote
1
answer
301
views
Why is my LazyColumn item's clickable modifier not working in Jetpack Compose?
I'm working on a Jetpack Compose app where I have a LazyColumn displaying a list of items. Each item is wrapped in a Surface with a clickable modifier, but clicking the items doesn't seem to work. I'...
0
votes
1
answer
42
views
How can I conditionaly remove the default behavior of an anchor (a) tag added by insertAdjacentHTML
I am trying to add an anchor tag that should redirect the user to another page only if a condition is met (here if array.length<3). I have followed Iananswer of this SO question, but in my case I ...
0
votes
4
answers
80
views
Combining 2 addEventListeners which do the same thing into 1
I would like clicking div-1 and div-2 to do the same thing but please how can I combine the 2 eventlisteners functions into 1
var div_1 = document.getElementById("div-1");
var div_2 = ...
0
votes
0
answers
46
views
Jetpack Compose: onClick working on device but not on emulator
Using the following function, The Toast and the Logcat output show when I run on a device, but not on emulators (I am using Pixel 5 API 33, Nexus 5 API 33, Pixel 3A API 33); using Android Studio ...
2
votes
3
answers
88
views
Run custom function before open in new tab
I am using an <a> tag instead of a button because I need to add the feature that allow user to right click and then open in new tab:
The issue right now is that this tag have an onClick ...
0
votes
1
answer
93
views
Execute the same javascript function from different onclick events [duplicate]
I have the following javascript code that plays a video when I click the "play" button in HTML.
How can I play different videos (multiple play buttons in HTML) without duplicating the ...
0
votes
1
answer
72
views
Responsive navbar click
I try to get my navbar responsive. Follow this tut on w3schools. If I copy and paste it is working, but I want it to be mobile first (media queries) and there is my problem.
The switch from mobile to ...
0
votes
0
answers
95
views
Tracking any Notification click on Android
I'm in the process of enhancing a legacy app that receives various types of notifications, such as those from Firebase, third-party software, and even some that we create ourselves.
The data analytics ...
0
votes
0
answers
46
views
Message set with "setError()" on a clickable TextView is not shown
I am not able to find the correct configuration for the behaviour I want. I have a layout with 2 TextView for displaying a date (birth and death date). To set both dates, the user touches (onClick() ...
0
votes
1
answer
61
views
Using a class to open same popup using document.querySelector
I have a popup login box on my site, I use <a class="logincontent">Login</a> which then calls up this function:
document.querySelector('a.logincontent').onclick = () => {
...
0
votes
0
answers
38
views
Crash with no specific location (Android studio)
My app shows error in Google play analytics that I can't replicate mainly because it does not show me it's location.
I can only assume that it is related to some onClick method from one of many XML ...
1
vote
1
answer
114
views
js element.click() on focusable element does not shift focus to that element
I stumbled across this behaviour. I want that an input element receives focus, if you click it, so that it becomes the documents' active element. The click is generated programmatically via javascript ...
0
votes
1
answer
113
views
Can Button "without an onclick event" be nested inside Link component in NEXT JS
Is it acceptable to integrate a <button> element inside a Next.js <Link> component? I tried this approach, and it didn’t result in a hydration error. Is this a recommended practice, or ...
2
votes
0
answers
255
views
(Primevue) Function to stop horizontal scrollbar from moving when clicking on a Dropdown
There is a code within my system that makes the scrollbar reposition itself if a dropdown is clicked on a minimized window (click on a dropdown that's only halfway visible and this code readjusts ...
1
vote
1
answer
829
views
Trigger an onclick inside a PrimeVue Dropdown
I am trying to test using a console.log on a Dropdown inside a PrimeVue. Looking this up I was suggested I would use "item-template" but this seems like it is not used in the since it's not ...
0
votes
1
answer
39
views
Unable to get import to fix "onClick" unrecognized giving error
I'm new to Kotlin and I'm following a Room tutorial but (at about 32 minutes) I get an error that I wasn't able to fix:
This is my code:
@Composable
fun ContactScreen(
state: ContactState,
...
0
votes
0
answers
37
views
react-draggable issue on mobile devices
I have an issue with react-draggable library, when on mobile or tablet devices onClick from children are not propagated. Anyone knows which might be the reason?
<Draggable onStart={handleDragStart} ...
0
votes
1
answer
42
views
React js onclick function is triggering where it should not
I added an on-click event listener button inside the table but it is not functioning properly
it keeps triggering while populating data.
console while populating data
after cleaning the console I ...
1
vote
0
answers
42
views
When loading from a file, the .observe and .on_click functions don't work on a rerun of the cell
I'm using IPyWidgets in a Jupyter Notebook in VS Code. When making an interface, I use a .py file to code and load this into the notebook. This looks like the following:
import Moduals.TestFile as ...
0
votes
2
answers
40
views
React component button goes to different pages
I am trying to make this button component navigate to different web pages. There will be several buttons, but I am unable to make each one navigate to different pages.
I have the button component that ...
1
vote
1
answer
63
views
How to change content in an onclick function for all elements inside a button tag?
I have a layout where if the image and/or text are clicked, then it populates different information below it. If I have an img and paragraph inside the button, it will only work if you click anywhere ...
1
vote
0
answers
28
views
How to add onClick event to PopupMenuBarItem in Dojo?
I can't figure out how to add an onclick event to a menu item, please help me solve this problem.
<script>
require([
"dijit/MenuBar",
"dijit/PopupMenuBarItem&...
0
votes
2
answers
122
views
Button onclick shows hidden message javascript
The button needs to be edited in css to appear the way I have, that part worked. Then it needs to show a message that says "welcome to the world of coding!" upon clicking the button. I feel ...
1
vote
1
answer
287
views
Vite + Typescript can't call onClick function, not defined
I am working on weather app in Vite + Typescript, no framework, just plain TS.
I want to have delete function for each weather list item. When I click on delete button clickedID gets passed down to ...
2
votes
1
answer
85
views
Javascript onclick event based on corresponding id iterations
I am attempting to create dynamic modal popups from query feeds in WordPress. One feed displays elements that need to be clicked and one feed holds the content for the modal popups. My current code ...
0
votes
1
answer
68
views
Clicking a button to populate a div with value, and then use this value for an onclick function - Javascript
I have a text box here which when I click into it and press a letter, it populates with that letter. Then I click a button (Go) which takes the letter I have entered and runs a JavaScript function ...
1
vote
1
answer
37
views
jQuery onclick show value of dynamic checkboxes
I have this group of checkboxes displayed using a while loop form sql select. The checkboxes have values assigned to them from sql. I have assigned all the checkboxes the same class.
If I click on one ...
0
votes
0
answers
86
views
how to add a link to dropdown buttons
Currently I am working on a django project and I am trying to add a dropdown menu on home page to change password and Log out.I tried to add links to dropdown menu buttons but it didnt work . I used ...
1
vote
3
answers
93
views
Ajax send response successfully but PHP dont receive data
I have a shopping cart page and button like
`<button class="purchase-button" data-courses-id="<?php echo $coursesID; ?>" onclick="Payment()">
</button>`
...
0
votes
2
answers
49
views
onClick does not work on first click in React
I have a button that shows/hides an element when click but it does not work on first click but it works on the following clicks. I'm expecting it to work on the first click.
import { useState } from &...
1
vote
2
answers
115
views
Audio play button firing phantom second click when currentTime is modified programmatically, preventing playback
When I pause an Audio and set it's currentTime, it does something weird. when I press a button that controls the .paused state of the Audio, it seems to click again automatically, preventing the audio ...