I have 2 loops within 1 form where a link gets created within each loop. The first link on the first loop opens a pop up but all other links will open a new page. Not sure why all links don't open in a pop up
<script>
$(document).ready(function() {
$('#Popup').click(function() {
var newwindow = window.open($(this).prop('href'), '',
'height=800,width=800');
if (window.focus) {
newwindow.focus();
}
return false;
});
});
</script>
<form method='post' target = '_blank'>
foreach(do something){
echo "<a href='newpage1.php?cmd=get stuff" id='Popup''>View</a>";
}
foreach(do something){
echo "<a href='newpage2.php?cmd=get stuff" id='Popup''>View</a>";
}
</form>