Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Form to act as address bar.  (Read 8749 times)

0 Members and 1 Guest are viewing this topic.

Jacob

    Topic Starter


    Hopeful

    Thanked: 1
    • Experience: Expert
    • OS: Windows XP
    Re: Form to act as address bar.
    « Reply #15 on: September 19, 2008, 04:22:18 PM »
    The text box does not update with the new website and it does not go to the site you enter in the text box.
    What did you exactly add or change?
    So i know what i am testing?

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Form to act as address bar.
    « Reply #16 on: September 19, 2008, 04:27:54 PM »
    I added the JavaScript in the <head>....

    Code: [Select]
    function changeURL()
    {
      var url = document.getElementById('link').value;
      document.getElementById('linkframe').src = url;
    }

    The clickable image that changes the location:

    Code: [Select]
    <img border="0" src="files/images/refresh.bmp" width="11" height="11" onClick="changeURL()">

    And the ID to register witht the "getElementById" command:

    Code: [Select]
    <iframe id="linkframe" name="I1" width="100%" height="91%" src="http://www.google.com/" border="0" frameborder="0" align="left">
    Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>

    Jacob

      Topic Starter


      Hopeful

      Thanked: 1
      • Experience: Expert
      • OS: Windows XP
      Re: Form to act as address bar.
      « Reply #17 on: September 19, 2008, 04:32:33 PM »
      That images was used refresh the page, but fair enough.
      This works great, apart from say in the iframe i clicked to go to yahoo.com
      how would i get the text box to auto update with http://www.yahoo.com.

      kpac

      • Web moderator
      • Moderator


      • Hacker

      • kpac®
      • Thanked: 184
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: Form to act as address bar.
      « Reply #18 on: September 20, 2008, 04:32:20 AM »
      I'm not sure about that one, sorry. :(

      Jacob

        Topic Starter


        Hopeful

        Thanked: 1
        • Experience: Expert
        • OS: Windows XP
        Re: Form to act as address bar.
        « Reply #19 on: September 20, 2008, 04:47:13 AM »
        No worries, thanks for your great help anyway.
         ;D