Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js stop form submit on enter

<button type="submit" onclick="submitButtonClick(event)">Submit</button>
<script>
function submitButtonClick(event) {
		event.preventDefault();
		//other stuff you want to do instead...
} 
</script>
Comment

how to stop form from submitting on enter

<form ... onkeydown="return event.key != 'Enter';">
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to submit using checkbox 
Javascript :: react clear form after save 
Javascript :: get last three characters of string javascript 
Javascript :: generate random date in javascript 
Javascript :: show 5 entries in datatable 
Javascript :: header ejs 
Javascript :: javascript loop FormData 
Javascript :: wp_enqueue_script bootstrap 
Javascript :: node js list all installed modules 
Javascript :: clear ctx canvas with javascript 
Javascript :: regex between quotes 
Javascript :: get query from url react router dom v6 
Javascript :: javascript how to get a random element from an array 
Javascript :: discord.js kick user 
Javascript :: js pi 
Javascript :: remove last 3 characters from string javascript 
Javascript :: how to sort by newest document mongoose 
Javascript :: jquery remove option from select by value 
Javascript :: jquery append text to div 
Javascript :: js change url 
Javascript :: javascript canvas mousemove 
Javascript :: Javascript function to get the difference between two numbers 
Javascript :: check if letter is uppercase javascript 
Javascript :: NullInjectorError: R3InjectorError(DashboardModule)[DatabaseService - DatabaseService - HttpClient 
Javascript :: get iso date javascript 
Javascript :: each option select jquery 
Javascript :: get button text javascript 
Javascript :: js generate random boolean 
Javascript :: open json file r 
Javascript :: submit form using ajax 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =