dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Pop Up Window/Opening link in Parent Window

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    1

    Pop Up Window/Opening link in Parent Window

    Hello I am very new to this and thought posting here would help.
    Okay so I have a site where one of the links I have set up to open a pop up window which will display Terms & Agreement information, at the bottom there is a check box and a submit button for users to click on if they agree to the terms. I was able to get that working but the thing is when the user clicks in the check box and hits submit I want them to be directed to a page which has a form on it but I wanted the page to open in the original (Parent) window. This is where I am lost cause I found some coding which will open the page with the form in the pop up window but Ideally once they agree to terms and hit submit I'd like the pop up window to disappear and the new page open in the Parent window... is this possible below is the coding I'm using.

    Here is the form:
    <form method="get" action="this is where my link will go" onsubmit="return yes_no(this.form) " name="Agree">
    <INPUT name="agree" name="agree" value="agree" type="checkbox"> I agree to terms
    <input type="submit" name="submit" value="Accept Terms">
    </form>


    Javascript being used:

    <!--Pop Up Terms Window-->
    <SCRIPT TYPE="text/javascript">
    <!--
    function popup(mylink, windowname)
    {
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
    href=mylink;
    else
    href=mylink.href;
    window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
    return false;
    }
    //-->
    </SCRIPT>


    <!--Agree check box-->
    <script language="javascript1.2">
    function yes_no()
    {
    var agree=document.Agree.agree.checked;
    if (agree == true){
    return true;

    }else{
    alert("you must agree to terms if you would like to submit a story");
    return false;
    }
    }
    </script>


    <!--load page back in parent window-->
    <SCRIPT>
    function loadinparent(url, closeSelf){
    self.opener.location = url;
    if(closeSelf) self.close();
    }

    //-->
    </SCRIPT>

  2. #2
    Join Date
    May 2011
    Posts
    194

    popup object and popup method

    Hi,

    Internet Explorer knows a popup Object (if exist in actual DHTML DOM see http://msdn.microsoft.com/en-us/library/ms533050.aspx)

    You use a popup method.

    popup Object Internet Development Index

    --------------------------------------------------------------------------------

    A special type of overlapped window typically used for dialog boxes, message boxes, and other temporary windows that appear separate from an application's main window.

    Members Table

    The following table lists the members exposed by the popup object. Click a tab on the left to choose the type of member you want to view.

    Attributes/Properties

    Show:
    Attributes/Properties
    Methods
    Method Description
    hide Closes the pop-up window.
    show Displays the pop-up window on the screen.

    Property Description
    document Retrieves the HTML document in a given popup window.
    isOpen Retrieves a value indicating whether the popup window is open.




    Attributes/Properties

    Methods

    Remarks

    This object is available in script as of Microsoft® Internet Explorer 5.5.

    Examples

    The following example demonstrates the use of the popup object. The code creates a pop-up window and displays it.

    <SCRIPT LANGUAGE="JScript">
    var oPopup = window.createPopup();
    var oPopupBody = oPopup.document.body;

    oPopupBody.innerHTML = "Display some <B>HTML</B> here.";
    oPopup.show(100, 100, 200, 50, document.body);
    </SCRIPT>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles