Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

pass $_POST data into popup window

Javascript coding ..

Moderators: macek, egami, gesf

pass $_POST data into popup window

Postby ktsirig » Tue Apr 18, 2006 1:53 pm

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?
ktsirig
New php-forum User
New php-forum User
 
Posts: 36
Joined: Mon Sep 19, 2005 12:22 pm

Postby revq » Tue Apr 18, 2006 9:55 pm

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: Select all
<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.
User avatar
revq
New php-forum User
New php-forum User
 
Posts: 21
Joined: Mon Feb 13, 2006 1:54 am
Location: South Africa

Postby sanketce » Wed Apr 19, 2006 2:36 am

You can also call a javascript function that has window.open inside wiht filename.php?id=1 line.
sanketce
New php-forum User
New php-forum User
 
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.