vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need simple "URL field" with "Go" button.. Please help.. (https://vborg.vbsupport.ru/showthread.php?t=320955)

shibby2 12-02-2015 06:24 AM

Need simple "URL field" with "Go" button.. Please help..
 
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


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 :)

Quote:

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

Quote:

Originally Posted by shibby2 (Post 2560138)
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:
Code:

<input type="text" name="webseite"  size="50" placeholder="Type URL here" />

shibby2 12-10-2015 08:27 PM

Quote:

Originally Posted by ArcadeSyndicate (Post 2560142)
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 [DATE]1449786478[/DATE] at [TIME]1449786478[/TIME] ---------------

Quote:

Originally Posted by Dragonsys (Post 2560145)
in the input tag add a placeholder as such:
Code:

<input type="text" name="webseite"  size="50" placeholder="Type URL here" />

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

--------------- Added [DATE]1449866819[/DATE] at [TIME]1449866819[/TIME] ---------------

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!

Code:

<!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

HTML Code:

<!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

Quote:

Originally Posted by shibby2 (Post 2561073)
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

Quote:

Originally Posted by shibby2 (Post 2561084)
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

Quote:

Originally Posted by Dragonsys (Post 2561088)
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

Quote:

Originally Posted by Dragonsys (Post 2561088)
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

Quote:

Originally Posted by Dragonsys (Post 2561032)
Code:

<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>


Quote:

Originally Posted by shibby2 (Post 2561172)
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

Quote:

Originally Posted by Dragonsys (Post 2561088)
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! :)


All times are GMT. The time now is 08:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01166 seconds
  • Memory Usage 1,773KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (21)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete