Witam, mam problem z moją stroną. Mam podstronę wynik i historia. W historii jest tabelka w której jest kilka danych i przycisk pokaż. Mam napisaną funkcję, która wyświetla dane z tabeli w textarea na tej samej podstronie a chciałbym aby po kliknięciu w przycisk automatycznie przenosiło nas do podstrony wynik i tam w textarea wklejało te dane z historii. Da się to jakoś zrobić? Wklejam tą funkcję do przekazywania, która działa tylko jeśli textarea znajduje się w tej samej podstronie.
require_once('Database.php');
require_once('historyElement.php');
$database = Database::getInstance();
$elements = $database->findAllHistoryElements();
$i=1;
foreach ($database->findAllHistoryElements() as $historyElements)
{
?>
<tr>
<td><?=$historyElements->getName();?></td>
<td style="display: none;"><input type="hidden" name="historyElement_<?=++$i?>" value="<?=$historyElements->getContent();?>"></td>
<td><p id="historyElement">\(<?=$historyElements->getContent();?>\)</p></td>
<td><?=date('H:i:s d.m.Y', $historyElements->getTime());?></td>
<td><a href="generator.php"><button onclick="showHistory(<?=$i?>);" >Pokaż</button></a></td>
</tr>
<?php
}
?>```
Funkcja w JS:
```function showHistory(id) {
var txt = $('[name=historyElement_' + id + ']').val();
$('#wzory').val(txt);
updateMathContent(txt);
}```