popup window
Moderator: General Moderators
popup window
Hi there. Still can't get this Javascript popup to work. No Window pops up and when I hover over the link it shows the wrong url. Please help
print "<tr>
<td width=9%>$line[date]</td>
<td width=20%>$line[recipient]</td>
<td width=30%>$getline[equipment]</td>
<td width=5%>$line[quantity]</td>
<td width=5%>$line[status]</td>
<font color=#0033CC><td width=4%><a href= updateloan.php?rowid=$line[id]><font color='#0000FF'>Edit</font> </a></td></font>
<td width=5%><a href=\"#\" onClick=\"window.open('viewloan.php?rowid=" . $line[id] . "', 'View Loan',
'width=370,height=240,status=1'); return false;\"><font color='#0000FF'>View</font> </a></td>
</tr>
</table>";}
print "<tr>
<td width=9%>$line[date]</td>
<td width=20%>$line[recipient]</td>
<td width=30%>$getline[equipment]</td>
<td width=5%>$line[quantity]</td>
<td width=5%>$line[status]</td>
<font color=#0033CC><td width=4%><a href= updateloan.php?rowid=$line[id]><font color='#0000FF'>Edit</font> </a></td></font>
<td width=5%><a href=\"#\" onClick=\"window.open('viewloan.php?rowid=" . $line[id] . "', 'View Loan',
'width=370,height=240,status=1'); return false;\"><font color='#0000FF'>View</font> </a></td>
</tr>
</table>";}
why make it cleanner by adding the JS to a function, ie:
Code: Select all
function openwin() {
window.open("page.html", "title", "toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no,width=315,height=400");
}
<a href="javascript:openwin()"> Click me</a>- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
works for me. Although you may want to changetoyou'll get a php notice to the effect of
I'd generally agree with tim here, that a function is a better direction to go for simplicity anyway.
Code: Select all
=" . $lineїid] . "Code: Select all
".$lineї'id']."Code: Select all
"id not found, assuming 'id'"
Last edited by feyd on Tue Apr 20, 2004 5:19 pm, edited 1 time in total.
Still not working guys!:) When I hover over the link it shows website.com/loanreport.php# and no window pops up. It should be website.com/viewloan.php?id=#. It should loop and get each row id number. I can use a function but now it's to the mpoint where i won't give up.
print "<tr>
<td width=9%>$line[date]</td>
<td width=20%>$line[recipient]</td>
<td width=30%>$getline[equipment]</td>
<td width=5%>$line[quantity]</td>
<td width=5%>$line[status]</td>
<font color=#0033CC><td width=4%><a href= updateloan.php?rowid=$line[id]><font color='#0000FF'>Edit</font> </a></td></font>
<td width=5%><a href=\"#\" onclick=\"window.open('viewloan.php?rowid=" . $line['id'] ."', 'View Loan',
'width=370,height=240,status=1'); return false;\"><font color='#0000FF'>View</font> </a></td>
</tr>
</table>";}
print "<tr>
<td width=9%>$line[date]</td>
<td width=20%>$line[recipient]</td>
<td width=30%>$getline[equipment]</td>
<td width=5%>$line[quantity]</td>
<td width=5%>$line[status]</td>
<font color=#0033CC><td width=4%><a href= updateloan.php?rowid=$line[id]><font color='#0000FF'>Edit</font> </a></td></font>
<td width=5%><a href=\"#\" onclick=\"window.open('viewloan.php?rowid=" . $line['id'] ."', 'View Loan',
'width=370,height=240,status=1'); return false;\"><font color='#0000FF'>View</font> </a></td>
</tr>
</table>";}
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA