DrTrans Posted August 29, 2009 Share Posted August 29, 2009 How do i pass the hidden fields threw the onClick Heres the database connect: $connect = mysql_connect("lXXXXXXX","XXXX",""); mysql_select_db($tpdbname); $query = "SELECT * FROM applicant WHERE Applicant_ID = '$applicant'"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $applicantid = $row['Applicant_ID']; $appid = $row['ApplicantID']; $applicantfname = $row['FirstName']; $applicantlname = $row['LastName']; $applicantphone = $row['HomePhone']; $unitid = $row['PropertyID']; $applicantwphone = $row['WorkPhone']; Heres my window.open() if($screenstatus == "Declined") { print"<br> Screening: <font color=\"red\">$screenstatus</font></b>   <INPUT type=\"button\" value=\"Approve!\" onClick=\"window.open('approvedetail.php','mywindow','width=400,height=400')\"></form><hr>\n"; Basically when they click the approve button. it needs to know what the ID number of the record that they are approving. heres is what my applicantdetail.php file looks like: <html> <h4>Approval Required</h4> <form action="approvedetail.php" method="POST"> Approval For Applicant: <input type="text" name="applicant">$applicantid<br /> Approved By: <?php session_start(); $dbusername = $_SESSION['username']; echo"$dbusername"; ?><br /> Notes:<br /><textarea name="notes" cols="40" rows="10">Enter Notes Here...</textarea> <br /> <hr /><i>I have recorded your IP as:<?php echo $_SERVER['REMOTE_ADDR']; ?></i> <input type="submit" name="approve" value="Approve Applicant"> </form> Link to comment https://forums.phpfreaks.com/topic/172397-solved-passing-variables-via-javascript-onclick/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.