Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder thesmart1's Avatar
    Join Date
    Dec 2005
    Posts
    369
    Thanks
    7
    Thanked 3 Times in 3 Posts

    Address Bar on page

    Is there a way to make like an address bar on a webpage? Maybe a text input box with a button or link that opens the page in that window?

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure, you could make a form that acts like one.

    Why would you want to do that though?
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #3
    Regular Coder thesmart1's Avatar
    Join Date
    Dec 2005
    Posts
    369
    Thanks
    7
    Thanked 3 Times in 3 Posts
    I'm trying to make a side bar for myself in frames and surf the web in the main frame. I was just wondering if it would be possible to put an address bar on a page in the main frame. It would probably be done in DOM, but I'm not sure.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Place this in your top frame or side frame
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>&nbsp;</title>
    <style type="text/css">
    html, body {
    margin:0;
    padding:0;
    border:0;
    text-align:center;
    }
    body {
    padding:5px;
    }
    form {
    margin:0;
    padding:0;
    }
    </style>
    <script type="text/javascript">
    function goTo()
    {
    	window.frames['main'].location = document.forms[0].url.value; // change main to the name of your frame
    	return false;
    }
    </script>
    </head>
    
    <body>
    <form action="#" method="post" onsubmit="return goTo()">
    <label for="url">Address: <input type="text" name="url" id="url" size="75"></label>
    <input type="submit" value="Go">
    </form>
    </body>
    </html>
    Read the comments in the JS to see how to get the url to open in the main frame.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Regular Coder thesmart1's Avatar
    Join Date
    Dec 2005
    Posts
    369
    Thanks
    7
    Thanked 3 Times in 3 Posts
    It's not working

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Then you've done something wrong. Post the code for your frameset.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    Regular Coder thesmart1's Avatar
    Join Date
    Dec 2005
    Posts
    369
    Thanks
    7
    Thanked 3 Times in 3 Posts
    Home.html:
    Code:
    <html>
    <frameset rows="100,*">
    <frame name="topbar" src="topbar.html">
    <frame name="main" src="http://www.msn.com">
    </frameset>
    </html>


  •  

    Posting Permissions

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