disable submit button using jquery

In my case $('#btn_submit').prop("disabled", true); worked!

Update:

I was using kendo grid inside some specific rows I want to disable Edit and Delete inline buttons. I tried many alternate ways to disable it but .prop() worked like charm!


You can also disable the event like this,

$('form').submit(function(e)
{ 

e.preventDefault();
//then carry out another way of submitting the content.

}

Have an id or a name for the submit button. Disable that button only

For example:

HTML

<form id="frm_name">
     <input type="submit" id="btn_submit" value="Submit" />
</form>

jQuery

...
if (formId != ''){
    $('#btn_submit').attr('disabled',true);
    this.submit();
}
...

Tags:

Jquery