Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable button in vuejs

Tags:

laravel

vue.js

I want to make the button disabled during the form filling when all the inputs are filled the button will be enabled using vuejs and on laravel framework

I tried achive that by simply making the button disabled in the

<button type="submit" class="btn btn-info" disabled>Next</button> 

but i didn't know how to do it in vuejs

like image 429
mohamed lahsoumi Avatar asked Feb 26 '19 00:02

mohamed lahsoumi


People also ask

How do I disable my Vue button?

To disable a button in Vue. js, we set the disabled prop of the button. to set the disabled prop to the isDisabled reactive property. Therefore, the disabled attribute will be added to the button only if isDisabled is true .

How do I make a button disabled?

The disabled attribute is a boolean attribute. When present, it specifies that the button should be disabled. A disabled button is unusable and un-clickable. The disabled attribute can be set to keep a user from clicking on the button until some other condition has been met (like selecting a checkbox, etc.).

How do you make a button disabled in CSS?

To make the disabled button, we will use the Pure CSS class “pure-button-disabled” with the class “pure-button”. We can also create a disabled button using disabled attribute. Disabled Button used Class: pure-button-disabled: It is used to disable the Pure CSS button.


1 Answers

Just bind the disabled attribute to a boolean value like

<button :disabled='isDisabled'>Send Form</button> 

as in this example

like image 54
Roy J Avatar answered Oct 11 '22 18:10

Roy J