Jazzy 1012
asked on
Change variable when you click + or - on another end
I have this code:
First part
Here is the second part:
I can change the second part but the +and - sign, but how can it also change inside the first part?
This is my output, I put the number 1 next to the first part and number 2 next to the second part(which I explained the function of earlier)
First part
<div class="col-xs-4">
<div class="black" style=" display: -webkit-inline-box; padding-top: 50px;float: right;">
<div style="margin-right: 10px;">
<input disabled id="qty<?= $delivery_id1 ?>" type="number" value="<?=$num_of_meals1?>" min="0" step="1" style="border:1px solid #d7d6d0;background:transparent;width:35px;height:33px;color:#000;font-size:21px;font-weight:700;">
</div>
<input hidden="" id="price" value="">
<p style="width:60px;font-size: 20px;margin-top: 8px;" ><?php echo $qty_price1;?> </strong> </p>
</div>
Here is the second part:
<div style="margin-right: 10px;margin-top: -15px">
<input type="hidden" name="meal_id[]" value="<?php echo $meal_options_id2?>">
<i id="qty-minus<?=$meal_options_id2 ?>" class="fa fa-minus-circle controls" style="color: #d7d6d0;margin-right:10px"></i>
<input name="qty[]" id="qty<?=$meal_options_id2 ?>" type="number" value="<?=$num_of_meals2?>" min="0" step="1" style="border:1px solid #d7d6d0;background:transparent;width:35px;height:33px;color:#000;font-size:21px;font-weight:700;">
<i id="qty-plus<?=$meal_options_id2 ?>" class="fa fa-plus-circle controls" style="color: #d7d6d0;margin-left:10px"></i>
</div>
I can change the second part but the +and - sign, but how can it also change inside the first part?
This is my output, I put the number 1 next to the first part and number 2 next to the second part(which I explained the function of earlier)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window
How can I split the qty-plus212 into just a variable containing the id starting just from the first number in this case "212" so that I can add it to the
Open in new window
Number contains the changed qtys each time I add or remove