Hello, sorry for the newbie question, I’m exploring Vue.js and trying to use it in a research project.
In my app I create dynamically rows in a table.
Inside every row, I have 6 cells and in one cell I have an input field:
<input type="number" min=1 max=5 id="myID" name="myName" v-model:userChoice>
Most browsers “ignore” (it’s their default behavior)
max, so that the user can freely edit the input field and type a number that’s not in the range 1-5.
When the user has ended adding rows, I retrieve data related to the rows I stored in a rows array. Problem is data coming from the input could be invalid (eg. 0 or 6).
I would like to correct wrong values “live”: that is, if a user sets 0, I want that particular field filled with a red background (it’s just an example) and remove this background when the value is in the range. Is it possible?
(sub-question: is it possible to get a reference to a particular field when any field created dynamically has the same id?)
Thanks in advance