I'm trying to show the product quantity of a product depending on the product that was selected in the dropdown menu, however I can't figure out how to specifically get quantity from the lists.
Here is the select menu:
<select class="form-control" v-model="form.product_list">
<option disabled value="">Select Product</option>
<option v-for="product in products" :key="product.product_id" :value="product.product_id">{{product.product_name}}</option>
</select>
When you select a product from the select menu it binds it to form.product_list, after that I'm trying to show the product quantity instead of the product_id here: This does work however it shows the product_id instead of product quantity.
<td class="text-xs-left">
<p>{{form.product_list}}</p>
</td>`
Here's the data:
data () {
return {
products: {},
form: new Form({
product_list: '',
})
}
}
I'm aware that changing :value="product.product_id" to :value="product.product_quantity" inside the select element will solve the issue, however I'm still going to need the product_id when I insert it into the database later on.