Skip to main content

I'm trying to get the value of a button when it is clicked, because iI got multiple buttonbuttons depending on how much data iI got. So iI need to know which button did iI click. I got the code for the button like below.

<button type="submit" data-multiship-item-update="" class="action split" data-role="split" data-flag="0" value ="<?php echo $index ?>" <?php if ($reduce >= (int)$item->getQty()):?> disabled="disabled" <?php endif; ?>><span><?php /* @escapeNotVerified */ echo __('Add item(s) to Address') ?></span></button>

So the question is, how i can I get the value of the button if iwhen I click it?

I'm trying to get value of a button when it clicked, because i got multiple button depending on how much data i got. So i need to know which button did i click. I got code for the button like below.

<button type="submit" data-multiship-item-update="" class="action split" data-role="split" data-flag="0" value ="<?php echo $index ?>" <?php if ($reduce >= (int)$item->getQty()):?> disabled="disabled" <?php endif; ?>><span><?php /* @escapeNotVerified */ echo __('Add item(s) to Address') ?></span></button>

So the question, how i can get the value of the button if i click it?

I'm trying to get the value of a button when it is clicked, because I got multiple buttons depending on how much data I got. So I need to know which button did I click. I got the code for the button like below.

<button type="submit" data-multiship-item-update="" class="action split" data-role="split" data-flag="0" value ="<?php echo $index ?>" <?php if ($reduce >= (int)$item->getQty()):?> disabled="disabled" <?php endif; ?>><span><?php /* @escapeNotVerified */ echo __('Add item(s) to Address') ?></span></button>

So the question is, how can I get the value of the button when I click it?

Source Link
Edwin Widhiyanto
  • 856
  • 1
  • 15
  • 41

how to get button value after button clicked

I'm trying to get value of a button when it clicked, because i got multiple button depending on how much data i got. So i need to know which button did i click. I got code for the button like below.

<button type="submit" data-multiship-item-update="" class="action split" data-role="split" data-flag="0" value ="<?php echo $index ?>" <?php if ($reduce >= (int)$item->getQty()):?> disabled="disabled" <?php endif; ?>><span><?php /* @escapeNotVerified */ echo __('Add item(s) to Address') ?></span></button>

So the question, how i can get the value of the button if i click it?