Results 1 to 4 of 4

Thread: Redone the code

  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Redone the code

    I need to get the iframe to open when the test site is submitted. Please help me with this and thank you in advance for your time.

    <html>
    <head>
    <title>Website Resolution Tester</title>
    <script language="javascript">
    function runURL () {
    document.getElementById('newframe').src = document.myform.webadd.value
    return false
    }


    </script>
    </head>
    <body>
    <p>&nbsp;</p>
    <form name="myform" method="post" action="tester2.html" onsubmit="return runUrl()">
    Type the address of the site to test:
    <input type="text" name="webadd">
    <input type="submit" value="Click to Test">
    </form>

    <p>640x480</p>

    <iframe id="newframe" src="" width="640" height="480" frameborder="no">
    </iframe>
    </body>
    </html>

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Code:
    <html>
    <head>
    <title>Website Resolution Tester</title>
    <script language="javascript">
    function runURL () {
    document.frames['newframe'].src = document.myform.webadd.value
    return false
    }
    </script> 
    </head>
    <body>
    <p>&nbsp;</p>
    <form name="myform" method="post" action="tester2.html" onsubmit="return runUrl()">
    Type the address of the site to test: 
    <input type="text" name="webadd">
    <input type="submit" value="Click to Test">
    </form>
    
    <p>640x480</p>
    
    <iframe name="newframe" src="" width="640" height="480" frameborder="no">
    </iframe>
    </body>
    </html>
    Untested, but should work.
    - Mike

  3. #3
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it did not and i am completely stumped on this one.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Your code works (this is to the original posted). Just change in the form onsubmit attribute:

    Code:
    onsubmit="return runURL();"
    Case sensative helps, and for a test visit http://phphost.smackum.com/dd/other.html

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •