Returning false from jquery submit does not stop the form submitting

deeteedee

New Member
//it always ignore return false !! i also used event.preventDefault(); and it doesn't work .\[code\] <!DOCTYPE html> <html lang="en"> <head> <title>SO question 3569072</title> <script src="http://stackoverflow.com/questions/12742789/jj.js"type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('form[name=pForm]').submit(function() { alert('Submit blocked!'); return false ; // i also used event.preventDefault(); and it doesn't work }); }); </script> </head> <body> <form action="index.php" method="post" name="pForm"> <textarea name="comment" onclick="if(this.value =http://stackoverflow.com/questions/12742789/='skriv h?r...') this.value='';" onblur="if(this.value.length == 0) this.value='http://stackoverflow.com/questions/12742789/skriv h?r...';">skriv h?r...</textarea> <input class="submit" type="submit" value="http://stackoverflow.com/questions/12742789/Publicera!" name="submit" /> </form> </body> </html>\[/code\]
 
Back
Top