Questions tagged [preventdefault]
Javascript event method to cancel the event if it is cancelable, without stopping further propagation of the event.
preventdefault
978
questions
0
votes
1
answer
28
views
Prevent Default is not working in p-tabView
I'm using PrimeNG's p-tabView in my Angular application to manage multiple tabs. I want to prevent the tab from changing under certain conditions. I tried using the preventDefault method in the ...
0
votes
1
answer
61
views
preventDefault() not preventing page redirect on form submission
I have a simple form being submitted into a third-party form/db location (Acoustic) and I'm trying to prevent the page from being redirected after submission.
<form method="post" ...
0
votes
0
answers
32
views
How to prevent React 16 from propagating a Click to child component
Situation: I have a chat and a messagelist inside it, same as a WhatsApp chat screen. When clicking an image (<ModalImageCors\>), it opens an image modal. Ok. But if selectingMsgs state is true, ...
0
votes
0
answers
16
views
Angular event.preventDefault() doesn't work on android mobile
here is my code. but it is not working on android browser. Can someone have any solution for it?
const pattern = /^(?!.*[ ]{2})[^*|":<>[\]{}.,?/`~¥£€\\()\u2026₱§';@&$!#%^*_+=0-9-]+$/g;
...
0
votes
0
answers
15
views
How to open custom keyboard instead of default virtual keyboard when click on EditText in Android Studio?
My following code has prevented opening the default virtual keyboard, but it clears text cursor inside EditText too.
Have any way to do both of them at the same time?
mEdtSearch.setOnClickListener(new ...
-1
votes
1
answer
72
views
event.preventDefault() affecting further execution of code
There are 3 .ejs pages this project index.ejs, loading.ejs and result.ejs. index loads first and has the following code in its script tag:
document.addEventListener("DOMContentLoaded", ...
0
votes
0
answers
59
views
why preventDefault, stopPropogation, stopImmediatePropogation dont work with some elements?
i code an chrome extension and I need that on any site, when you click on any element, no action occurs on them, but they are painted over in a certain color
I first used preventDefault, then added ...
-1
votes
4
answers
166
views
Why doesn't preventDefault() of an input event stop changes to the value of a form element
This question has been asked and answered before; none of the previous answers given here seem to fix my situation. Therefore I need to ask, once again, why isn't the event prevented correctly?
...
0
votes
0
answers
29
views
RadzenTemplateForm keydown event not working in Chrome and Edge
I'm encountering an issue with the RadzenTemplateForm component where the keydown event is not functioning as expected in Chrome and Edge browsers. The code I'm using is as follows:
<...
0
votes
1
answer
52
views
I'm not able to find what e.preventDefault() does in trapFocus function
I understand what the function does, but I don't really know what does e.preventDefault() do. I know that prevents the default behaviour from the keydown event, but I don't really know which behaviour ...
1
vote
0
answers
38
views
Preventing from default behavior even though preventDafault() method has not been called yet
In this piece of code there is an element called container and a checkbox in it. There is
an EventListener on the container which calls a function if a click event happens on its
child or itself. This ...
-1
votes
2
answers
168
views
Stripe payment form constantly reloads @stripe/react-stripe-js preventDefault not working?
i followed this example https://stripe.com/docs/payments/link/add-link-elements-integration
I see the form where you put in credit card info.
clicking around inside and outside the form, it constantly ...
0
votes
1
answer
263
views
stopPropagation doesn't work with Ant design Dropdown Menu
I have a card component wrapped inside a nextjs Link. The card consists of a body and footer. this is my cardFooter. inside cardFooter I have an Ant Design DropDown menu with two items. as you can see ...
0
votes
1
answer
43
views
I'm getting an error in Django Templates, with the event.preventDefault();
I'm made a dajngo website where if the product have a field with is_active = False, it gonna remove it from the basket in the shop.
So wrote this script in html file:
{% if table.is_active ...
-2
votes
2
answers
469
views
"event.preventDefault();" doesn't work with a submit button
The problem is, when I click on a submit button the page is reloading, preventing the code to work, despite the fact that I have "event.preventDefault();".
HTML:
<form class="links-...