Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to prevent the form from getting automatically submitted javascript

//add event.preventDefault() example,

function clickHandler(event){
	alert("Hey you clicked the submit button");
	event.preventDefault();
}

//this will prevent the page from getting automatically refreshed after 
//the submit button is hit.
 
PREVIOUS NEXT
Tagged: #prevent #form #automatically #submitted #javascript
ADD COMMENT
Topic
Name
8+4 =