Hey All,
Struggling to get name, id query results into html list where
ea. id is stored in form with hidden input, and
corrispoding name is a hyperlinked submit() for same form.
<form name = 'id_1' method ='POST' value='id_1' action='target.php'>
<input type='hidden' name='id_1' value='id_1'></form>
<a href="javascript:document.id_1.submit()">name_1</a>
<form name = 'id_2' method ='POST' value='id_2' action='target.php'>
<input type='hidden' name='id_2' value='id_2'></form>
<a href="javascript:document.id_2.submit()">name_2</a>
<form name = 'id_3' method ='POST' value='id_3' action='target.php'>
<input type='hidden' name='id_3' value='id_3'></form>
<a href="javascript:document.id_3.submit()">name_3</a>
I'm thinking it is something like this...
$select_account="select id, name from accounts where name Like '%$search_account%'";
$result = mysql_query ($select_account);
while ($row=mysql_fetch_array($result)) {
$accountID = $row["id"];
$accountName = $row["name"];
$acct_name[] = "$accountName";
$acct_id[] = "$accountID";
}
foreach ($acct_id as $list_id){
$acct_list = "<form name='$list_id' method='post' action='account_data_frame.php' target='account'>";}
foreach ($acct_name as $list_name){
$acct_list.= "<input type='hidden' name='$list_id' value='$list_id'><a href='$list_id.submit()'>$list_name</a></form><br>";
}
echo $acct_list;
but I can't quite get it right. I can get a list with the name, or the id values but not both.
Anyone? Please...😃