I am trying to make items from an array clickable. I am pulling data from soap and creating an array in php. I then add it into a scroll-able table pulling only one of the columns entered data. The problem I am having is making the data clickable which would allow me to send another soap request pulling different information to populate different fields. I am able to do this by creating individual buttons and attaching the array. I would prefer to have it fill my table without manually creating each button as the data will be variable. I do have an Identifier as a column that could be used as a variable to initiate the request once clicked. If someone can point me in the right direction that would be great. Main thing is the button function but if there is an easy way to do the second request that will push the ID that the button sends to a variable to use for the request that would be a bonus. Thanks in advance for any help.
To recap:
data is pulled from soap service - array is created - array is filtered for specific column data - data is populated into table - click on item within table sends a soap request based on ID from array - data is received from soap back into php - seperate fields are populated with new data.
here is how I am currently pulling data into the table once it has been requested:
<?php
function pull_name ($item1){
return $item1['Name1'];
}
$name1 = array_map('pull_name', $array);
echo('<tr>');
echo('<td>');
echo(implode('</td><tr><td>', $name1));
echo('</td</tr>');
echo('<tr>');
?>
I was able to do a table with buttons like this:
<tr>
<td><input type="button" value="<?php echo $array['0']['Name1'];?>"></td>
</tr>
<tr>
<td><input type="button" value="<?php echo $array['1']['Name1'];?>"></td>
</tr>