i have a data entry form in which i need to look-up to another page hence the pop-up page which contains a table from the database with a column named checkno.
now from the main form i will clicked a button then it will display the popup page(i have already managed to do this.)
my only problem now is when im in the popup page, when i click a certain value in the checkno column, this value will be passed to the textbox to my main form, so it would seem that all the values in the column checkno will look like a link so that it can be selected and clicked.
can anybody help me..
this is my initial code
this is my form.php
<html>
<head> <title> form </title>
<script src="../javascript/list.js"> </script>
</head>
<body>
<form action="" name="addcashadv" method="post">
<table class="mytable" align="center">
<tr><th colspan="3"></th></tr>
<h2 align="center"> Add CA </h2>
<tr>
<td>Check Number:</td>
<td>
<input type="text" name="chekno" id="checkno" value="" />
<input type="button" onClick="List()" value="List of Checks">
</td>
</tr>
</table>
</form>
</body>
</html>
this is my javascript to open pop-up
function List() {
window.open( "viewchecks.php", "myWindow",
"status = 1, height = 600, width = 800, resizable = 0" )
}
this is my viewchecks.php
<html>
<head>
<title> </title>
<link rel="stylesheet" a href="stylesheets/style.css" type="text/css"/>
<script src="../javascript/list.js"> </script>
</head>
<body>
<?php
include "classes/pgsql_db.class.php";
include "classes/checks_class.php";
$conn = new pgsql_db();
$checks = new checks($conn);
$cdata = $checks->getChecks(); # get_results
?>
<h2>Checks</h2>
<table id="checksTable" table border="1" cellpadding = "3" class="mytable_data">
<?php
if(!empty($cdata)){
foreach($cdata as $data)
{
echo "
</tr>
<td width='70'><a href='#' > ".$data->checkno." </a></td>
<td width='110'>".$data->checkdate."</td>
<td width='100'>"."P ".$data->amount."</td>
<td width='400'>".$data->payee."</td>
</tr>";
}
}else{
echo "<p class='error italic'>There are no checks.</p>";
}
?>
</table>
</body>
</html>
can anybody pls help me? i've know that i might have to use some javascript or ajax in this procedure but still not yet experienced in ajax or javascript. i would really appreciate it