ben03 0 Posted August 16, 2019 Report 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> Quote Link to post Share on other sites
justsomeguy 1,135 Posted August 16, 2019 Report Share Posted August 16, 2019 If you need it to be an input, then why print "NA" at all? Quote Link to post Share on other sites
dsonesuk 929 Posted August 16, 2019 Report Share Posted August 16, 2019 Why put them all in input and disable empty value input. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.