I have this loop where I'm creating a link, but bootstrap modals prevents me to use PHP variables properly from the top loop (Yes a loop in loop). So I decided to use jQuery and get the id from the button when it's clicked, and that is fine, but how do I append this into the link without appending the whole link, because there is another ID variable which I'm using again in this links? Here in $value->getId() I need to append value from jQuery.
foreach ($exploredArtistBands as $band) { echo '<a href="/notification/invite/' . $value->getId() . '/' . $band['band_id'] . '">Join to ' . $band['name'] . '</a><br />'; } $('.invite').click(function(){ $(this).attr('button-id') });
.clickcallback, that way you have the value of thebutton-idwen you need it