View Full Version : URL bar
viktor
11-11-2006, 04:55 PM
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?
tech_support
11-12-2006, 06:39 AM
I think it's
<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.
Probably, you mean:
<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.
viktor
11-12-2006, 07:22 PM
its not working, when I click Go nothing happens. :confused:
viktor
11-15-2006, 04:42 AM
can anyone help please?
tech_support
11-15-2006, 05:36 AM
Huh? Twey gave you the code. ^^^^^
Ah, sorry, I failed to return false:
<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.
viktor
11-16-2006, 11:31 PM
Ah, sorry, I failed to return false:
<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?
<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
tech_support
11-17-2006, 04:54 AM
That's not a good code.
See where "frame_name" is? Replace it with your frame name and see if that helps.
viktor
11-17-2006, 10:25 PM
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
tech_support
11-21-2006, 06:44 AM
Yeah, but if you don't have the frame you want as the "default" frame then it won't work.
viktor
11-22-2006, 05:59 PM
I know that. All I want is for this code to open the new page in a frame called lets say "Sample". I tried putting target attribute inside the form but that doesn't work. I think there has to be a change somewhere in the JS code. I can't figure it out.
<form name="jumpurl1" onSubmit="return jumpit()">
<input type="text" size=30 name="jumpurl2" value="http://">
<input type="button" value="Surf" onClick="jumpit()">
</form>
<script>
function jumpit(){
window.location=document.jumpurl1.jumpurl2.value
return false
}
</script>
I want the new page to open in a frame "Sample" when someone enters url in the textfield and hits enter.
viktor
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.