Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

prevent form submit html javascript jquery

    // BEST OPTION
	JUST:
* delete the <button></button> in the friggin FORM and add <a></a> with the same style instead, THE FORM WONT BE SUBMITTED THIS WAY. 
* REMOVE THE action="" and method="" tags, and replace them in JQUERYJS fetch() or $.ajax() functions!

** VOILA **

    //option B
    $("form").submit(function(e){
        e.preventDefault();
    });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #prevent #form #submit #html #javascript #jquery
ADD COMMENT
Topic
Name
9+9 =