Forum Moderators: open
I finally got a link to open a new window and I finally found out how to close that window. The problem is that the form is not submitting the information to the data base.
The link:
<A HREF="javascript:void(window.open('form.htm'))">Add</A><BR>
The form page:
<form method="POST" action="addtodb.php">
<input>
'
'
'
<input>
<input type="submit" value="Item Select Item" onClick="window.close()">
</form>
adtodb.php
$a_id =$_POST['id'];
$a_name = $_POST['name'];$strSQL = "INSERT INTO table (id, name)
VALUES ('$a_id', '$a_name');
mysql_query($strSQL, $myConn) or die (mysql_error());
echo "<script>alert('" . $intIndex . " Added!');</script>";
Since I added the "onClick="window.close" the form is not passing the values. Why?
Thanks