Linked Questions
420 questions linked to/from event.preventDefault() vs. return false
43
votes
1
answer
15k
views
What's the difference between e.preventDefault(); and return false? [duplicate]
$("a.avatar").click(function(e){
e.preventDefault();
$("#thumbnails").fadeIn();
});
and
$("a.avatar").click(function(e){
$("#thumbnails").fadeIn();
return false;
}...
5
votes
2
answers
28k
views
Easy way to prevent default action when using "onclick" of a checkbox? [duplicate]
This is my current solution:
html
<input type="checkbox" value="1" onclick="return do_stuff();" />
<input type="checkbox" value="1" onclick="return do_stuff2();" />
javscript:
function ...
8
votes
3
answers
10k
views
Javascript native equivalent for jQuery event.preventDefault [duplicate]
Possible Duplicate:
event.preventDefault() vs. return false
I'm not sure, but as far as I see, event.preventDefault is coming from jQuery. if yes, I'm wondering is there any native equivalent in ...
9
votes
2
answers
2k
views
what e.preventDefault() method really does? [duplicate]
I have tried preventDefault() for submiting the form without page reload but its not giving any result to me. Can anyone explain what is the purpose of preventDefault() method in JQuery???
4
votes
3
answers
2k
views
What is the different return false and event.preventDefault in javascript? [duplicate]
I searched for a similar question and someone claimed that return false is similar to event.stopPropagation() and event.preventDefault(), but I have tried the claimed examples and it doesn't work. The ...
5
votes
1
answer
2k
views
jQuery .preventDefault and .stopPropagation used inside a function returning false [duplicate]
jQuery documentation states:
"When utilizing both .preventDefault() and .stopPropagation() simultaneously, you can instead return false to achieve both in a more concise manner..."
This is in regard ...
3
votes
1
answer
653
views
Jquery and Flask: how to understand the 'return false' in form submit function [duplicate]
In my project, I use Python Flask working as the server side and JS as the front end. The project allows user to select a photo and send the photo to the server side with AJAX post method. And server ...
2
votes
1
answer
382
views
Difference - "e.preventDefault();" and "return false;" [duplicate]
What is difference between return false; and e.preventDefault(); ?
0
votes
2
answers
371
views
Javascript- Prevent page redirection after validation [duplicate]
I have a drop down- If user tries to submit the page, but doesn't choose an option from the dropdown, then I want an ALERT message box to appear, then for the page to stay where it is instead of ...
2
votes
4
answers
221
views
after submitting a form to email i get 2 email instead 1 [duplicate]
after submitting a form to email i get 2 email instead 1 how can i fix it? I need that only 1 letter come to email
js:
app.controller('threeCtrl',function($scope){
$("#subBusinessOne").click(...
2
votes
1
answer
196
views
What are the cases when `return false` does not do the same thing as `e.preventDefault()`? [duplicate]
Possible Duplicate:
JavaScript: event.preventDefault() vs return false
What are the cases when return false does not do the same thing as e.preventDefault() ?
(Note I'm not talking about jQuery events....
-1
votes
1
answer
77
views
Why `return` is used in javascript event function [duplicate]
Html: <input type="text" onkeypress="return isNumberKey(evt)" />
JavaScript:
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (...
0
votes
1
answer
48
views
How to prevent defaut behaviour of "input submit"? [duplicate]
I have an input submit, after attaching an onclick handler on it, what's the standard way to prevent a post request to "form action=xxx" url? Is it "return false", or "e.preventDefault", or "e....
user avatar
user6902625
429
votes
30
answers
1.2m
views
Disabled href tag [duplicate]
Although that link is disabled, it's still clickable.
<a href="/" disabled="disabled">123n</a>
Can I make it not-clickable if it's disabled? Should I use JavaScript necessarily?
442
votes
16
answers
372k
views
Binding arrow keys in JS/jQuery
How do I go about binding a function to left and right arrow keys in Javascript and/or jQuery? I looked at the js-hotkey plugin for jQuery (wraps the built-in bind function to add an argument to ...