Link to home
Start Free TrialLog in
Avatar of Benji_
Benji_Flag for United Kingdom of Great Britain and Northern Ireland

asked on

PHP Page Facebook Style Popup

Hi guys,

I am wondering how i would get a Facebook stylepopup which opens up in the page an i can split data out of a Dropdown box. without the page refreshing.

Best Regards
Avatar of Matthew Kelly
Matthew Kelly
Flag of United States of America image

The basically do the below. They have a hidden absolute positioned high z index div that has switches its display on when a button is clicked.

Now what they really do is much more complicated, such as:
 - They calculate the screen dimensions for the margins to get it on the center of the page
 - They use AJAX to dynamically grab content on the fly when a button is clicked instead of having just the text filled into the div on page load
 - etc


<div id="popupMsg" style="position:absolute;margin-top:100px;margin-left:100px;z-index:999;display:none;">Pop up message</div>
 
 
<a href="#" onclick="document.getElementById('popupMsg').style.display='block';"></a>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Matthew Kelly
Matthew Kelly
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Benji_

ASKER

Thanks!,

i will have a pay around with what you have sent me looks right for what i need,

in reference to the Java Dropdown how would i split the content down

a value will look like this

ID:Name:Length
3838:My Option Name:18


What i would then need to do with that information from popup one  is do a query based on the ID number, in popup two and then use the information from popup 2 on some different fields.


best Regards
Avatar of Benji_

ASKER

How do i load differnt data into that popup window?

best Regards
Avatar of b0lsc0tt
>> How do i load differnt data into that popup window? <<
What do you mean different?  What is the data exactly?  What are the cases or tests for the data?
To load it if you use an element like the one described you would use element.innerHTML to change or set the contents.  For example if your pop up has a div with the id "results" where you want the data then you would use ...
document.getElementById("results").innerHTML = "The data for the element";
Let me know what else you need or if you have a question.  Of course there may be other ways to do it but the above works if the page is already loaded and you just want to change an element.
bol
Avatar of Benji_

ASKER

Hi,

Thanks for the reply i have detailed what i am trying to achive below.


When someone has set a dropdown box to say "12", "18","24" and so forth depending on the data type i want to be able to use that in an SQL query in which i can then get more data from the the Database, this information wouldnt be avalible until the user starts to fill the form in,

I want either a facebook style popup or how would i get data from a java popup window into my parent,

(I am open to both and any more ideas you have)

best Regards
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Benji_

ASKER

is Ajax fully compatible with PHP as i am using a linux server with cPanel.

Best Regards
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Benji_

ASKER

Thanks for the advise guys.