button to navigate to a new page, but exit the iframe too.

Discussion in 'HTML & Website Design' started by ggr, Jun 22, 2010.

  1. #1
    Hello,
    I am new to web programming. I have a main page which has links @ the top which loads different web pages within an iframe.

    With 1 of the pages, I have a button, to send the user to a login page.
    But with the button, when clicked, the login page is loaded within the iframe.
    I want the page to load on its own.

    I had a link, but folks are complaining that they are unable to see the link, so chose a button.

    Here is the like I had which worked fine:
    <a href="http://localhost/users/login.php" target="_parent">Login to Database</a>

    Here is the button I have:
    <INPUT TYPE="BUTTON" VALUE="Login to Database" ONCLICK="window.location.href='http://localhost/users/login.php'">

    So how do I make that button bring up that login page by itself than have it within an iframe?

    Please advise. Thanks

    -GGR
     
    ggr, Jun 22, 2010 IP
  2. ggr

    ggr Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Solved it.

    All I had to do was to change the "ONCLICK" calling.

    INPUT type="button" value="Login to Database" ONCLICK="window.parent.location='http://localhost/users/login.php'">

    This will open up the link on the same window, but will occupy the entire page.
     
    ggr, Jun 22, 2010 IP