Problems with value attribute set on input
See original GitHub issueVersions:
- VueJs: v2.1.8
- Vee-Validate: 2.0.0-beta.18
Description:
I have a text input field that I’d like to set the “value” attribute on without using a Vue data model. Essentially am wanting PHP to do the HTML rendering of the input and Vue/Vee to do the JS validation. If no value attribute is set, it works fine. If a value attribute is set, then it will not allow any editing of the field (well, it simply changes back to the originally inputted value quickly… you can test with debounce to see that happen)
Steps To Reproduce:
Here is code to reproduce the issue (just note the value=“My Value” attribute):
HTML:
<div id="form">
<label class="label" for="email">Email</label>
<p :class="{ 'control': true }">
<input value="My Value" v-validate data-vv-rules="required|email" data-vv-name="email" :class="{'input': true, 'is-danger': errors.has('email') }" name="email" type="text" placeholder="Email">
<span v-show="errors.has('email')" class="help is-danger">{{ errors.first('email') }}</span>
</p>
</div>
Javascript:
<script type="text/javascript">
Vue.use(VeeValidate, { delay: 500});
new Vue({
'el': '#form'
})
</script>
I feel like I’m missing something here easy and haven’t been able to find it yet. Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Input element's value attribute is not set · Issue #18725 - GitHub
Current behavior. When initializing a FormControl with an initial value, the html input element's value attribute is not set. Expected behavior.
Read more >HTML Input is not updating value attribute on change
The value attribute contains the default value for an input, not the live value. The DOM value property contains a live value.
Read more ><input>: The Input (Form Input) element - HTML
The autocomplete attribute takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input ...
Read more >HTML5 Forms: Value Attribute - Wufoo
The value attribute is used to set the value of <input> elements: it defines the value associated with the input and the value...
Read more >Set the value of an input field in JavaScript - GeeksforGeeks
text: It specifies the value of the input text field. · attributeValue: This parameter is required. It specifies the value of the attribute...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have same issue with Vue 2.2.0. It happens when I use v-bind:value=“”
https://jsfiddle.net/g0xjq2nk/10/
Thanks for checking in on this and providing an update @logaretm… much appreciated and great work on this plugin.