Note that there are some explanatory texts on larger screens.

plurals
  1. POidentify jquery button click in php rows
    text
    copied!<p>I have an input button in :</p> <pre><code>while ($row = $result-&gt;fetch()) { echo '&lt;table class="cart-row" cellspacing="0" cellpadding="0" width="100%"&gt;'; echo '&lt;tbody&gt;'; echo '&lt;tr&gt;'; echo '&lt;td width="75"&gt;&lt;img border="0" width="59px" height="78px" title="" alt="" src=' . $row["ImagePath"] .'&gt;&lt;/td&gt;'; echo '&lt;td width="203"&gt;&lt;span id="itemName" class="itemElements"&gt;'. $row["Name"] .'&lt;/span&gt;&lt;/td&gt;'; echo '&lt;td width="135"&gt;&lt;span id="qtyNum"&gt;('. $row["Qty"] .')&lt;/span&gt; &lt;br /&gt;'; echo '&lt;span id="qtyRemoveLink"&gt;&lt;input class="linkbtn" type="submit" id="btnRemove" value="Remove"&gt;&lt;/td&gt;'; echo '&lt;td width="180"&gt;&lt;span id="orderStatus" class="itemElements"&gt;In Stock Usually dispatched within 24 hours&lt;/span&gt;&lt;/td&gt;'; echo '&lt;td width="175" id="itemPriceRow"&gt;&lt;span id="itemPrice"&gt;€ '. $row["Price"] .'&lt;/span&gt;&lt;/td&gt;'; echo '&lt;/tr&gt;'; echo '&lt;/tbody&gt;'; echo '&lt;/table&gt;'; echo '&lt;br&gt;'; } </code></pre> <p>I'm trying to use this method to trigger an event when the button is clicked however the event is only being fired for the first button generated in the first row. I'm using this method:</p> <pre><code>$(document).ready(function() { $('#btnRemove').click(function() { alert("test"); }); }); </code></pre> <p>Any ideas how I can fix this problem? I know in C# there is on row databound method however in jQuery I dont now if it exsists. Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload