Jump to content

[SOLVED] passing variables via javascript onClick


DrTrans

Recommended Posts

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>&nbsp&nbsp&nbsp<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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.