so the question is: how do I insert my "btn-increase" value from front end to my SQL table. When I try to submit my form it inserts the value as 0 although the value was set to 4 on the form.
Here is the code:
<label class="form-label">$ / per hour</label>
<div class="d-flex align-items-center">
<div class="btn btn-items btn-items-decrease">-</div>
<input class="form-control input-items" name="price" type="text" value="1" disabled>
<div class="btn btn-items btn-items-increase">+</div>
</div>
// ------------------------------------------------------- //
// Increase/Decrease product amount
// ------------------------------------------------------ //
$(".btn-items-decrease").on("click", function () {
var input = $(this).siblings(".input-items");
if (parseInt(input.val(), 10) >= 1) {
if (input.hasClass("input-items-greaterthan")) {
input.val(parseInt(input.val(), 10) - 1 + "+");
} else {
input.val(parseInt(input.val(), 10) - 1);
}
}
});
$(".btn-items-increase").on("click", function () {
var input = $(this).siblings(".input-items");
if (input.hasClass("input-items-greaterthan")) {
input.val(parseInt(input.val(), 10) + 1 + "+");
} else {
input.val(parseInt(input.val(), 10) + 1);
}
});
Then using PHP I'm trying to get the incremented value from the form but it doesn't read the set value. How should I go about inserting the set js value using PHP?
I'm sure this may come off as super easy I'm just really stuck on how to go about this, thanks.