I need to call a javascript or a php function from a form made in php, so that I could make change in data base on clicks.
1)I included the function on onclick event on submit but nothing happens.
2)The file name in which this code is include is view_users.php
could someone hel me solve this
<?php
mysql_select_db("programmers") or die(mysql_error());
$data = mysql_query("SELECT * FROM user_allotment")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
echo "<tr>";
echo "<td>".$info['id'] . "</td>";
echo "<td>".$info['uname'] . "</td> ";
echo "<td>".$info['password'] . "</td>";
$id=$info['id'];
echo "<form method="post" action="view_users.php">";
echo "<td><label><input type="button" name=/"$id/" value="edit" align="middle" onclick="edit()"/></label></td>";
echo "<td><label><input type="button" name=/"$id/" value="delete" align="middle" onclick="edit()"/></label></td>";
echo "<td><label><input type="checkbox" name=/"$id/" value="privilege" align="middle" onclick="edit()"/></label></td>";
echo "</form>";
echo "</tr>";
}
?>
Calling a javascript function from php
Started by alena1347, Jan 28 2013 11:46 PM
php form java script function
1 reply to this topic
#1
Posted 28 January 2013 - 11:46 PM
#2
Posted 29 January 2013 - 12:44 AM
Events execute on the browser, while PHP executes on the server.
http://thorpesystems.com | http://proemframework.org | http://github.com/trq
SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












