1
rated 0 times
[
6]
[
5]
/ answers: 1 / hits: 8226
/ 4 Years ago, sun, august 9, 2020, 12:00:00
Could you please tell me how to get input field value on the button click. I want to get input tag value on button click which is Button Tag separated.
Here is my code below:
<div class="details-filter-row details-row-size">
<label for="Qty">Qty:</label>
<div class="product-details-quantity">
<input type="number" id="Qty" class="form-control" value="1" min="1" max="10" step="1" data-decimals="0" required>
</div>
</div>
<div class="product-details-action">
<button value="{{$ProductById->id}}" @click="addTo_Cart($event)" class="btn-cart btn-product" style="font-size: 1.3rem;" title="Add to cart">add to cart</button>
</div>
And my Script below:
<script>
export default{
data: function () {
return {
}
},
methods: {
addTo_Cart(e) {
// console.log(JSON.stringify(e.target.value));
},
}
};
</script>
More From » forms