I have a question. If I wanting to create a pop up javascript form - but pre-populate some of the input boxes with php variable... how do I go about that exactly?
So for every row that the query produces I want to be able to have the option of editing the details for each individual employee by way of a JavaScript pop up form.
It will need to pre-populate with the following info...
I know how to program to edit.php and the form itself... i just don't know how to carry over the row info to the pop up form. Can someone help me?
Cheers!
Code:
$query = 'SELECT * FROM employees'; $results = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array( $results )) { echo $row["name"].'<br />'; echo $row["job_role"].'<br />'; echo '<a href="/">EDIT EMPLOYEE DETAILS</a>'; }
It will need to pre-populate with the following info...
Code:
<form action="edit.php"> <input name="name" type="text" value="'.$row["name"].'" /><br /> <input name="name" type="text" value="'.$row["job_role"].'" /><br /> <input name="name" type="text" value="'.$row["salary"].'" /><br /> <input name="submit" type="button" value="Save Details" /><br /> </form>
Cheers!

Comment