I apologize in advance if this has been answered but I've tried all the suggestions I've found but still no joy.
In PHP, I have pulled data from a database and displayed it in a table inserting a button in the first cell of each row titled with a PHP variable. Clicking that button should call a javascript function that opens a child window to display details of data on that row.
Everything works fine except for the fact that I cannot pass a PHP variable to the javascript function. Passing hard-coded integer or string data appears to work.
Here is the java script:
<script language='javascript' type='text/javascript'>
function myPopup(id) {
window.open('flowdetail.php?uuid='+id, 'myWindow','status = 1, height = 300, width = 300, resizable = 0' )
};
</script>
Here is the code in the target window (echos passed value just for testing):
<?php // content="text/plain; charset=utf-8"
$uuid = $_GET['uuid'];
echo $uuid;
?>
Here is the PHP that populates the table and offers the button:
echo "><td><input name='found_one' type=button ";
echo "onClick=myPopup($uuid); value='$ctags[$z]'/>" .
" " . $results['location'] . "</td><td style='word-wrap: break-word'>" . substr($results['description'],0,140) . "</td><td>" . $cpname . "</td>";
I've been hacking at this for days so any help would be greatly appreciated!