Using mysql_query results to create an html form like below with auto incremented prefixed value for div ids:
<div id="favorite'.$count.'">
<form action="javascript:void(0);" method="post">
<input type="hidden" name="sec" value="'.$ident_inpt.'"/>
<input type="hidden" name="t" id="t'.$count.'" value="mo-'.$usr.'-'.$rmid.'-'.$_SESSION['STORE'].'"/>
<input type="submit" value="'.$lang['590'].'" class="favorites" onclick="upd_favorite();"/>
</form>
</div>
How can I get the ids of favorite### and t### so that I can get the loop going?
I use this but only works with static ids:
$('#favorite').html(ajaxRequest.responseText);
and: var addit = document.getElementById("t").value;
Thanks in advance for any suggestion.
You could also specify a common class across the elements:
And then you can grab them all like:
You could also specify a custom attribute like:
And grab them like: