Hey i have a page with contains a text field called customer id. the thing is if the user doesnt know this id the they can perform a custome id lookup. to do this the user clicks a button which opens a popup window using javascript, this ne window contains the form containg 2 text fields. when the user clicks the submit button i want the 2 values that where entered to be passed to the original window and the result displayed in the text box (customer id). the thing is when i click submit the page is loaded in the popup window. does any one have any help thanks alot. here is the code for each object.
------------------main page------------------------
<?php
$first_name = $_POST['first_name'];
$surname = $_POST['surname'];
$conn = @mysql_connect("217.194.210.4", "nonlinea", "eQHoSCIx#9")
or die("Err:Conn");
$rs = @mysql_select_db( "nonlinea", $conn ) or die ( "Err:Db" );
$select = "SELECT customer_id FROM customer_table WHERE first_name = '$first_name' AND surname = '$surname'";
$rs = mysql_query( $select, $conn );
while($row = @mysql_fetch_array($rs,MYSQL_ASSOC))
{
$customer_id = $row['customer_id'];
}
?>
-------Tetx field "customer id"------------------
<input name="customer_id" type="text" id="customer_id" value="<?php echo "$customer_id"; ?>">
----------button to open popup window---------------
<form><div id="Layer4"><INPUT type="button" value="ID Lookup"
onClick="window.open('lookup.htm','mywindow','width=400,height=200')">
</div></form>
---------form in popup window--------------
<form action="new-sale.php" method="post" target="_parent">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="114"> Name</td>
<td width="286"><input type="text" name="first_name" /></td>
</tr>
<tr>
<td> Surname</td>
<td><input type="text" name="surname" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="find" /></td>
</tr>
</table>
</form>
cheers again