ben03 Posted August 16, 2019 Share Posted August 16, 2019 I have a load of data coming from the database, of which I have not control of. When it comes in I am putting it in an html table. I have set up a basic if statement: If it is a blank field, show 'NA'. If not, show the figures in an input that a user can edit. The trouble I am running into is if a user backspaces the characters in the input, it then of course beomes the static text 'NA', but I need it to remain an input! What can I do in this scenario to prevent this from happening? I am using Vue.js, below is what I am using: <div v-if="item.value === ''"> NA </div> <div v-else> <input class="input is-small" v-model="item.value"> </div> Link to comment Share on other sites More sharing options...
justsomeguy Posted August 16, 2019 Share Posted August 16, 2019 If you need it to be an input, then why print "NA" at all? Link to comment Share on other sites More sharing options...
dsonesuk Posted August 16, 2019 Share Posted August 16, 2019 Why put them all in input and disable empty value input. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now