Go Back   Dynamic Drive Forums > General Coding > HTML
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 11-11-2006, 04:55 PM
viktor viktor is offline
Junior Coders
 
Join Date: Dec 2004
Posts: 71
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?
Reply With Quote
  #2  
Old 11-12-2006, 06:39 AM
tech_support's Avatar
tech_support tech_support is offline
Modarator Man.
 
Join Date: May 2006
Location: Sydney, Australia - Near the coast.
Posts: 2,011
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
Reply With Quote
  #3  
Old 11-12-2006, 01:53 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
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!
Reply With Quote
  #4  
Old 11-12-2006, 07:22 PM
viktor viktor is offline
Junior Coders
 
Join Date: Dec 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default not working

its not working, when I click Go nothing happens.
Reply With Quote
  #5  
Old 11-15-2006, 04:42 AM
viktor viktor is offline
Junior Coders
 
Join Date: Dec 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can anyone help please?
Reply With Quote
  #6  
Old 11-15-2006, 05:36 AM
tech_support's Avatar
tech_support tech_support is offline
Modarator Man.
 
Join Date: May 2006
Location: Sydney, Australia - Near the coast.
Posts: 2,011
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
Reply With Quote
  #7  
Old 11-15-2006, 09:08 AM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
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!
Reply With Quote
  #8  
Old 11-16-2006, 11:31 PM
viktor viktor is offline
Junior Coders
 
Join Date: Dec 2004
Posts: 71
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
Reply With Quote
  #9  
Old 11-17-2006, 04:54 AM
tech_support's Avatar
tech_support tech_support is offline
Modarator Man.
 
Join Date: May 2006
Location: Sydney, Australia - Near the coast.
Posts: 2,011
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
Reply With Quote
  #10  
Old 11-17-2006, 10:25 PM
viktor viktor is offline
Junior Coders
 
Join Date: Dec 2004
Posts: 71
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
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:47 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.