pass $_POST data into popup window

A

Anonymous

Guest
Hi all!
I have a page (generated with PHP) that has a list of employee names. What I want to do is, when the user hits on each name, a pop-up window (using Javascript) to appear which will say some more details on the employee (i.e his age, job experience etc).
So I thought I make a form for each employee name, and use hidden fields to pass the info I want.
For example

<form>
<input type="hidden" name ="age" value="23 years old">
<input type="hidden" name="experience" value="expert">
<input type="submit" value="John">
</form>

With the above, I show a little example of course. What I have is a submit button with John's name written in it and I want, when the user clicks on John, a pop-up window to appear and contain the "hidden" values of age and experience in it.
I don't know much about Javascript, i tried usind the document.write function, but no luck. I can only "send" data to the next page that are written in an input field, but not data that are written in hidden fields...
Any thoughts?
 
Assuming the info is stored in a db, don't bother with forms, simply have a link where you pass the primary key of the record to the page. eg-

Code:
<a href="...php?id=2" target="_new">John</a>

No need for advanced javascript, just take in the id on the next page and pull that data from the db, display it and you're sorted.
 
You can also call a javascript function that has window.open inside wiht filename.php?id=1 line.
 
Back
Top