i have some problem with following code....
please help..
<html>
<head>
<script type=text/javascript>
function checkit(par1, para2){
if (par1=='del'){
alert ("Are you sure to delete. id:" +para2);
}
}
</script>
</head>
<body>
<form>
<?php
include_once("connect.php");
$result=sql_query("SELECT * FROM category");
while ($row=sql_fetch_row($result){
echo "<tr><td>".$row[id]."</td>";
echo "<td><input type=button id='del' valve='delete' onclick='return checkit('del','".$row[id]."')</td></tr>";
}
echo "</table>";
?>
<input type=button value='click me' name='del' onclick= return checkit('del','1002')>
</form>
</htm>
when i try it from second button "clicke me" it work but from first "delete" no activity, how can i fix it...
please help///
please help..
<html>
<head>
<script type=text/javascript>
function checkit(par1, para2){
if (par1=='del'){
alert ("Are you sure to delete. id:" +para2);
}
}
</script>
</head>
<body>
<form>
<?php
include_once("connect.php");
$result=sql_query("SELECT * FROM category");
while ($row=sql_fetch_row($result){
echo "<tr><td>".$row[id]."</td>";
echo "<td><input type=button id='del' valve='delete' onclick='return checkit('del','".$row[id]."')</td></tr>";
}
echo "</table>";
?>
<input type=button value='click me' name='del' onclick= return checkit('del','1002')>
</form>
</htm>
when i try it from second button "clicke me" it work but from first "delete" no activity, how can i fix it...
please help///