Jump to content

alternate popup using div is it possible?


sayedsohail

Recommended Posts

Hi everyone,

 

I am just wondering if anyone had come across something like alternate to using window.open.

 

Please guide me if this is possible to use <div> element as an alternate to popup.

 

At the moment i am using window.open which works perfectly fine.

 

But just wondering if i can open a php file inside a div element i.e, i got a simple registration form with usual login name and password and submit button, which i wish to open inside a div element in the current window instead of using a popup window.

 

I knew it is possible if i type the registration form within the current window and div element, than i can trigger style visibility= visible, which shows the registration form using z-index, but i want to separate out/branch out the form code in a external file and refer it inside the div.

 

Please advise.

 

Thanks

Sayeed

 

Link to comment
https://forums.phpfreaks.com/topic/59706-alternate-popup-using-div-is-it-possible/
Share on other sites

thanks, as i mentioned earlier in the last paragraph "I knew it is possible if i type the registration form within the current window and div element, than i can trigger style visibility= visible, which shows the registration form using z-index, but i want to separate out/branch out the form code in a external file and refer it inside the div."

 

Hope you got my point.  What i am trying to achieve is to display the form/open the form.php file inside a div element without using iframes or typing directly echo "div"; ...

Yes something like this but, how do i dynamically include a php file/form inside div id=2.

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Show/Hide Div</title>
    <script language="JavaScript" type="text/javascript">
      <!--
      function toggleDiv(divId) {
        if(document.getElementById(divId).style.display=="") { 
      		document.getElementById(divId).style.display="none"; 
      	} 
      	else { 
      		document.getElementById(divId).style.display=""; 
      	}
      }
      //-->
    </script>
  </head>
  <body>
    <div id='1'>
      Div 1<br /><br />
      Always show!
    </div>
    <a href="#" onclick="toggleDiv('2');">Click to show/hide</a>
    <div id="2" style='display:none'>
      Only show after clicking!
    </div>
  </body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.