Hi anyone can help me create a js or any way to make this possible I already have working Pop up form, and a table with query and database, and also The POP UP form is already appearing when I click it. the problem is the result is always empty. here is my code
The table
<tr>
<td ><a onclick="openForm()">'. $row["ID"] .'</a></td>
<td>'. $row["RVID"] .'</td>
<td>'. $row["RVDate"] .'</td>
<td>'. $row["Name"] .'</td>
</tr>
This is the Popup form, it only appear when click the id in the table and its already working but empty
<div class="form-popup" id="popupForm">
<form class="formContainer">
<h1>Info</h1>
<label><b>Name</b></label>
<input type="text" name="rvname" value="<?php echo $row['Name']; ?>">
<label><b>ContactNumber</b></label>
<input type="text" name="contactnumber" value="<?php echo $row['ID']; ?>">
<button type="button" class="btn cancel" onclick="closeForm()">Close</button>
</form>
</div>
This is the script for opening and closing the popup box
function openForm() {
document.getElementById("popupForm").style.display = "block";
}
function closeForm() {
document.getElementById("popupForm").style.display = "none";
}
This is the sql,
<?php include 'C:\\Users\\Ace\\Sites\\db.php';
$result =$pdo->query("SELECT * FROM tblrv WHERE ID='" . $_GET['id'] . "'");
$row = $result->fetch(PDO::FETCH_BOTH);
with the help the $_GET['id'] if my address has example like this www.test.cc/records/?id=3891
then when Opening the POP UP Form the input box will show the name and number for the id 3891(that was i want). so maybe anyone can help me if I open the popup form, the $_GET will use? I also tried href and onclick like this <td ><a onclick="openForm()">'. $row["ID"] .'</a></td>
, but the page will refresh and the popup box will close so its not working
I hope someone have extra time to give me the best script