Vue.js enable disable input field


Vue.js enable disable input field It is very simple to enable disable form input field. Here in this article we are going to create one input field and submit button to implement this functionality.


Vue.js enable disable input field Example

Here is simply example of enable/disable input form field-

Enable/Disable Vue.Js Example:

                            
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.0/vue.js"></script>
</head>
<body>
<script>
new Vue({

  el: '#app',
  data: {
    isDisabled: false
  }

})
</script> 
<div id="app">

  <input type="text" :disabled="isDisabled">
  <button @click="isDisabled = !isDisabled">Enable/Disable</button>

</div> 
         
</body>
</html>                                                                                                                                                                         

Try it »

If you run the above example it will produce output something like this-

Vue.js enable disable input field

Advertisements

Add Comment

📖 Read More