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
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"; ...

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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