Log in

View Full Version : Need simple "URL field" with "Go" button.. Please help..


shibby2
12-02-2015, 06:24 AM
Hey, I was wondering if someone could help me. I'm looking to add a simple field at the bottom of my forum where users can type or paste in the URL to another site, and hit a "Go" button which will open a new window with the site they typed in. That's all, should be simple I would think.

Can anyone show me the code to do something like that? Would really, truly appreciate it.

Thanks! :)

shibby2
12-03-2015, 04:56 PM
Anyone know where I might be able to find the code for this? Would appreciate any leads.. thanks!

shibby2
12-10-2015, 01:26 AM
Anyone? I'll PayPal ya $10 for a working code! :D

ArcadeSyndicate
12-10-2015, 02:04 PM
DEMO (http://www.arcade-syndicate.net/gobutton.html)

don't forget http:// ;)

paypal=detoxxx[at]mail.ru :D

shibby2
12-10-2015, 02:19 PM
Awesome! Thank you so much! :) But, can you make the site open in a new window? Also, how would I make the field 'longer' if I needed to?

ArcadeSyndicate
12-10-2015, 02:28 PM
klick demo again, size="50"


[edit] new window now too

http://www.arcade-syndicate.net/gobutton.html

shibby2
12-10-2015, 05:40 PM
Great, thanks! It opens in a new window, however the other page also goes to the new site also. Any way to keep that on the original page?

Oh, and one more question... how hard would it be if I wanted to add some 'greyed' out text in the field (something like "type URL here") that disappears after they click in the field?

Thanks again, you're a life saver! PayPal payment on the way!

ArcadeSyndicate
12-10-2015, 06:10 PM
at first thank you :)

however the other page also goes to the new site also. Any way to keep that on the original page?

how do you mean that :confused:

do you use internet explorer?

in chrome it works fine, even in a new tab as usual.

Dragonsys
12-10-2015, 06:46 PM
Oh, and one more question... how hard would it be if I wanted to add some 'greyed' out text in the field (something like "type URL here") that disappears after they click in the field?

in the input tag add a placeholder as such:
<input type="text" name="webseite" size="50" placeholder="Type URL here" />

shibby2
12-10-2015, 08:27 PM
at first thank you :)



how do you mean that :confused:

do you use internet explorer?

in chrome it works fine, even in a new tab as usual.

I'm using FireFox. It opens the URL in a new window, but the page that the field is on also changes to the new URL, so you have two pages open with the URL. Just tried it in IE also, and it does the same thing.

--------------- Added 1449786478 at 1449786478 ---------------

in the input tag add a placeholder as such:
<input type="text" name="webseite" size="50" placeholder="Type URL here" />

Thanks, I'll give it a try! :)

--------------- Added 1449866819 at 1449866819 ---------------

Does anyone else have this problem? If you click the link above, and input a URL in the field, does it open that URL in BOTH windows, or just the 'new' window?

It loads and opens the URL in BOTH windows for me in FireFox and IE. :(

shibby2
12-23-2015, 06:34 AM
Can anyone help me to figure out why the URL is opening in both windows, instead of just the new window, in both IE and FireFox?

ArcadeSyndicate has bailed on me (after I paid him too).

Thanks for any help!


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript">
function WebseiteAufrufen () {
window.open(location.href = document.getElementsByName("webseite")[0].value);
return false;
}
</script>
</head>
<body>
<form action="" onsubmit="return WebseiteAufrufen();">
<input type="text" name="webseite" size="50" />
<input type="submit" value=" GO! " />
</form>
</body>
</html>

Dragonsys
12-23-2015, 12:11 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript">
function WebseiteAufrufen () {
window.open(href = document.getElementsByName("webseite")[0].value);
return false;
}
</script>
</head>
<body>
<form name="form1" action="#" onsubmit="return WebseiteAufrufen();" target="_blank">
<input type="text" name="webseite" size="50" />
<input type="submit" value=" GO! " />
</form>
</body>
</html>

shibby2
12-23-2015, 07:54 PM
Thank you for helping, I really appreciate it!

However, now I get a ERROR 403 - FORBIDDEN in the new window. :(

Dragonsys
12-23-2015, 10:04 PM
Thank you for helping, I really appreciate it!

However, now I get a ERROR 403 - FORBIDDEN in the new window. :(

That is on the server you are trying to go to with the form, I cannot help with that one, sorry. Try putting http://www.google.com in the form

shibby2
12-23-2015, 11:17 PM
Hmm, I was trying to go to http://www.ebay.com

It does the same with Google. :(

Dragonsys
12-24-2015, 01:00 AM
Hmm, I was trying to go to http://www.ebay.com

It does the same with Google. :(

not sure, it works perfectly fine on my site: http://dragonsys.noip.me/test.htm

ArcadeSyndicate
12-24-2015, 11:33 AM
not sure, it works perfectly fine on my site: http://dragonsys.noip.me/test.htm

i don't understand what the problem is too.

shibby2
12-26-2015, 04:53 AM
not sure, it works perfectly fine on my site: http://dragonsys.noip.me/test.htm

Hmm, works for me on your site, but not mine. :/

I copied the code right from your site, and will replace it with my code and see if that makes a difference.

Thanks!

blind-eddie
12-26-2015, 03:03 PM
<head>

<script type="text/javascript">
function WebseiteAufrufen () {
window.open(href = document.getElementsByName("webseite")[0].value);
return false;
}
</script>
</head>
<body>
<form name="form1" action="#" onsubmit="return WebseiteAufrufen();" target="_blank">
<input type="text" name="webseite" size="50" />
<input type="submit" value=" GO! " />
</form>
</body>


Hmm, works for me on your site, but not mine. :/

I copied the code right from your site, and will replace it with my code and see if that makes a difference.

Thanks!

Hey shibby2, try this.

Add the head code above to your header template and add the body code to the template you want the URL input box to show, both without the head and body brackets.

Wmteknik
12-27-2015, 08:20 PM
Thank you

shibby2
12-29-2015, 06:05 PM
not sure, it works perfectly fine on my site: http://dragonsys.noip.me/test.htm

Replaced it with the code taken directly from your site, and now it works perfectly. Thank you!

And thanks to everyone else who has offered help, I really appreciate it! :)