I'm writing a php file to display a table and there's a link in every row.When clicked,the hyperlink leads to a new browser window.Each link needs a viriable to show in alertbox.
My php code:
<tr>
<td>.....</td>
..
..
<td><? echo "<a href='PDelPaper.php?Type=One&sPaperID=$rowpart[PaperID]' onclick='return makesureone(".$rowpart[PaperName]."
;'>Delete</a>";?></td>
The makesureone function:
<SCRIPT language=JavaScript>
function makesureone(papername)
{
var agree = confirm("Are you sure to delete"+papername+"£¿"
;
if (agree)
return true;
else
return false;
}
</SCRIPT>
The problem is that it only works when the $rowpart[PaperName] is numeric,not when it's string.
Can u help me?thx~~~
My php code:
<tr>
<td>.....</td>
..
..
<td><? echo "<a href='PDelPaper.php?Type=One&sPaperID=$rowpart[PaperID]' onclick='return makesureone(".$rowpart[PaperName]."
The makesureone function:
<SCRIPT language=JavaScript>
function makesureone(papername)
{
var agree = confirm("Are you sure to delete"+papername+"£¿"
if (agree)
return true;
else
return false;
}
</SCRIPT>
The problem is that it only works when the $rowpart[PaperName] is numeric,not when it's string.
Can u help me?thx~~~