Results 1 to 2 of 2

Thread: iFrame Address Bar

  1. #1
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Default iFrame Address Bar

    I need to make an address bar for an iFrame.
    I have one page with an iFrame in it.
    I need a text form field on that page that has a 'Go' button.
    Then, if someone types in 'dogs' and hits 'Go,' it will change:
    HTML Code:
    <iframe id="iframe" height="95%" width="100%" frameborder="0" src="http://www.mydomain.com/mypages/mainpage.htm"></iframe>
    to
    HTML Code:
    <iframe id="iframe" height="95%" width="100%" frameborder="0" src="http://www.mydomain.com/mypages/dogs.htm"></iframe>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    HTML Code:
    <iframe id="iframe" height="95%" width="100%" frameborder="0" src="http://www.mydomain.com/mypages/mainpage.htm"></iframe><br>
    <input id="goput" type="text"> 
    <input type="button" value="Go" onclick="document.getElementById('iframe').src='http://www.mydomain.com/mypages/'+document.getElementById('goput').value+'.htm';">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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