Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: URL bar

  1. #1
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question URL bar

    Hey guys,
    I can't find this code in DD, it used to be there.
    It was just a textfield with a button. So you could enter url of
    a site in that textfield click go and the page would open in the other frame.

    I need some help on this.

    viktor

    ps. anyone knows any simple codes for random ads?

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    I think it's

    HTML Code:
    <form name="form_url" method="post" onsubmit="document.frames['frame_name'].location = this.form.elements['url'].value">
      <label>Url:
      <input name="url" type="text" id="url" size="100">
      </label>
      <label>
      <input name="go" type="submit" id="go" value="Go">
      </label>
    </form>
    Untested though.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Probably, you mean:
    Code:
    <form method="post" onsubmit="window.frames['frame_name'].location.href = this.elements['url'].value">
      <label>Url:
        <input name="url" type="text" size="100">
      </label>
      <label>
        <input name="go" type="submit" value="Go">
      </label>
    </form>
    I hate those [html] tags... it messes up the formatting when one copies and pastes.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default not working

    its not working, when I click Go nothing happens.

  5. #5
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can anyone help please?

  6. #6
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Huh? Twey gave you the code. ^^^^^
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Ah, sorry, I failed to return false:
    Code:
    <form onsubmit="window.frames['frame_name'].location.href = this.elements['url'].value; return false;">
      <label>Url:
        <input name="url" type="text" size="100">
      </label>
      <label>
        <input name="go" type="submit" value="Go">
      </label>
    </form>
    If it's vital to the operation of your site, remember to provide server-side backup.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    Ah, sorry, I failed to return false:
    Code:
    <form onsubmit="window.frames['frame_name'].location.href = this.elements['url'].value; return false;">
      <label>Url:
        <input name="url" type="text" size="100">
      </label>
      <label>
        <input name="go" type="submit" value="Go">
      </label>
    </form>
    If it's vital to the operation of your site, remember to provide server-side backup.

    Hey, thanks for trying but it wouldn't work. =/
    However, I found the code that I was talking about. It works, but now I can't figure out how to open it inside my frame. I tried putting target attribute everywhere inside form but no luck. I think it has to be inside JS code somewhere.

    Can anyone help me out on this?

    Code:
    <form name="jumpurl1"  onSubmit="return jumpit()">
    <input type="text" size=30 name="jumpurl2" value="http://">
    <input type="button" value="Go!" onClick="jumpit()">
    </form>
    <script>
    function jumpit(){
    window.location=document.jumpurl1.jumpurl2.value
    return false
    }
    </script>
    thanks,
    v1k

  9. #9
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    That's not a good code.

    See where "frame_name" is? Replace it with your frame name and see if that helps.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  10. #10
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by tech_support View Post
    That's not a good code.

    See where "frame_name" is? Replace it with your frame name and see if that helps.
    I got that code.

    I was talking about the second code, it has nothing for frame name. The one that uses jumpit function.

    viktor

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
  •