I have a loop that that retrieves rows from the database and spits it out in a table.
For every row I have a button that is generated. So if I have 5 rows, 5 buttons appear. Currently when I press any of the buttons, JavaScript will hide the button, replace it with "Button Pressed" and then open a window.
I would like where when the user presses the button that the #StartDate
variable and the $StartTime
variable both be carried over to the new window where the user can do other functions with that specific row. I tried using forms within the echo but that did not return any values. I also tried the $_SESSION
function with no luck. How would one be able to carry each row over to a window when that row's button is clicked on?
function buttonpressed(button) {
button.style.visibility = "hidden";
document.getElementById("ChangeButton1").innerHTML="Button Pressed";
window.open ('test2.html','newWin', 'width=400,height=400');
}
while($row = odbc_fetch_array($rs))
{
$StartDate=odbc_result($rs,"StartDate");
$StartTime=odbc_result($rs,"StartTime");
echo '
<tr>
<td class="td" valign="top"><p id="ChangeButton"><input type="submit" name="buttonpressed" value="buttonpressed" onclick="SendEmail(this); return false;"></p></td>';
echo '
<td class="td" valign="top">' . $StartDate . '</td>
<td class="td" valign="top">' . $StartTime . '</td>
</tr> ';
}