Hi all,
I run a query in PHP on an existing database and convert resulting records (OrderNumbers) into hyperlinks. This spits out a number of results so the user can click any of the links. I would like to be able to click on the link and load the link's name into variable, so I can run another query using this variable later on. Or really just load the link's name into a hidden form field, whatever.
E.g. how can you? <a href="javascrip t:void(0)" onclick="Get the 'test' value and load it into variable or hidden form field?">test</a>
Below is the code generating links.
[PHP]
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr >";
echo "<th>Order Numbers Found:</th>";
"<th>Total Qty</th></tr>";
while (odbc_fetch_row ($rs))
{
$orderno=odbc_r esult($rs,"Orde rNo");
$qty=odbc_resul t($rs,"BuyQty") ;
echo "<tr><td>". "<a href=\"$orderno \">$orderno</a>" . "</td>";
echo "<td>$qty</td></tr>";}[/PHP]
Thanks
Speedy
I run a query in PHP on an existing database and convert resulting records (OrderNumbers) into hyperlinks. This spits out a number of results so the user can click any of the links. I would like to be able to click on the link and load the link's name into variable, so I can run another query using this variable later on. Or really just load the link's name into a hidden form field, whatever.
E.g. how can you? <a href="javascrip t:void(0)" onclick="Get the 'test' value and load it into variable or hidden form field?">test</a>
Below is the code generating links.
[PHP]
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr >";
echo "<th>Order Numbers Found:</th>";
"<th>Total Qty</th></tr>";
while (odbc_fetch_row ($rs))
{
$orderno=odbc_r esult($rs,"Orde rNo");
$qty=odbc_resul t($rs,"BuyQty") ;
echo "<tr><td>". "<a href=\"$orderno \">$orderno</a>" . "</td>";
echo "<td>$qty</td></tr>";}[/PHP]
Thanks
Speedy
Comment