How To Disable Submit Button Using Bootstrap

A form contains many input fields with submit button using Bootstrap. However, sometimes you need to enable or disable submit button of the form. But, what you have to do to disable the submit button with Bootstrap?

You will get the user input data easily using Bootstrap form. After the user enters their details and clicks the submit button. You will get the input data in the database or through email. However, sometimes you do not want the user to click the submit button. In that condition, you can use the Bootstrap to disable the submit button.

Disable Button Type Submit With Bootstrap

To disable any submit button and other buttons of a form. You have to add the attribute disabled="disabled" with the button to make it disabled. After you disable the button, users may not be able to submit the form.

See the example given below to disable button type submit.

Test it Live


The above example contains the input text and the button type submit. After you add the attribute disabled, you will get the button that becomes disable to click. You can try to click the above button. But, it is in a disabled state.

How To Disable Input Type Button Using Bootstrap

You can disable the input type submit using the attribute disabled="disabled". You have to just put the attribute in the input type to make it disable.

Test it Live


The above example contains the input text and the input button. Hover over the above button to see what effect you will get after making it disabled.

Create Login Form Bootstrap and Disallow User to Click Button

In addition to the above all, you may also want sometimes to disallow a button to click. This is required when you don’t want all users to fill the login form and click the submit button. You may also like to read how to make the input field required using Bootstrap.

In that case, you also have to use the same attribute disabled="disabled".

Test it Live


The above example contains the login form with input for username and password. Fill the above form by entering the username and password. In the end, you can try to click the submit button. However, the button is disabled and you cannot submit the form by clicking the button.

You may also like to read

Hope, you like this post of how to not allow users to click on submit button. If you have any query regarding the tutorial, please comment below.

Bootstrap Doc to Learn Classes to Disallow Button Click

Also tell me, which method you are using to disable your button using Bootstrap.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.