Disable submit type button

Code examples

1
0

on form submit disable button

$('form#id').submit(function(){
    $(this).find(':input[type=submit]').prop('disabled', true);
});
0
0

disable submit type button

// default type attribute of plain html button is "submit", so it will trigger submitting a form. 
// add type="button" to a button in form to disable default behavior of submitting the form.

<button type="button" onClick={-do something else like a console log-}>Not a Submit</button>

// also could use preventDefault()
const handleClick = (e) => {
  e.preventDefault()
// do something
} 

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................