Search
 
SCRIPT & CODE EXAMPLE
 

HTML

stop form submission on press enter button

$('form [name="disc"]').keydown(function (e) {
    if (e.keyCode == 13) {
        e.preventDefault();
        return false;
    }
});
Comment

how to stop form from submitting on enter

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

prevent button from submitting on enter key

function validationFunction() {
  $('input').each(function() {
    ...

  }
  if(good) {
    return true;
  }
  return false;
}

$(document).ready(function() {
  $(window).keydown(function(event){
    if( (event.keyCode == 13) && (validationFunction() == false) ) {
      event.preventDefault();
      return false;
    }
  });
});
Comment

prevent form submission on enter key

<form action="...">
  <!-- Prevent implicit submission of the form -->
  <button type="submit" disabled style="display: none" aria-hidden="true"></button>

  <!-- ... -->

  <button type="submit">Submit</button>
</form>
Comment

PREVIOUS NEXT
Code Example
Html :: git origin vs remote 
Html :: html input name and value and id 
Html :: HTML <figure and <figcaption Elements 
Html :: xhtml 
Html :: createjs 
Html :: how to make link open in new tab 
Html :: solidity syntax return 
Html :: bootstrap offcanvas 
Html :: express js search example 
Html :: angular html variable 
Html :: BEM example html 
Html :: html error 
Html :: how to create a button input 
Html :: ubuntu 17.04 vmware 
Html :: HTML <sup Element 
Html :: rich text editor mvc razor 
Html :: how to make clicking button send you down to a certain section of page html 
Html :: load html from project in swift 
Html :: blizard.js print 
Html :: Search CSV files for text 
Html :: i = ["hi", "he", 
Html :: Front-End WebHooks 
Html :: c# how to get src from html img 
Html :: display time div 
Html :: HTML <q for Short Quotations 
Html :: select html gray safari 
Html :: vue children not reload route params change 
Html :: autoplay controls html5 
Html :: how to disable movable textarea in html 
Html :: Load webpage from html string 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =