Help - Search - Members - Calendar
Full Version: Coding a url linked submit box
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Adrianthelibrarian
Hi all.

I am trying to find a way to code an html page, that will simply ask the name of a website without the www. and the .com . On hitting submit, it will add the www and .com the go through to that site.
So it would simply look like -

Enter the title of the site in textbox.

You enter "Google".

On submit you go direct to www.google.com

I am not sure if you have to use some in page script. The more basic, the better.

Many thanks for any help.


A
pandy
Yes, you need to use some kind of programming. JavaScript would do and it's simple enough as long as you only want to cater to one single top level domain.

CODE

function reDirect()
   {
      var where = document.getElementById('domain').value;
      window.location.href = 'http://' + where + '.com';
      return false;
   }


HTML
<form onsubmit="return reDirect()">
<fieldset>
<legend>Go to another page</legend>
<label for="domain">Type the name of the site:</label>
<input type="text" name="domain" id="domain">
<input type="submit">
</fieldset>
</form>


But in the real world there are many top level domains. How will you know if I want to go to google.com, google.co.uk, google.com.au, google.fr, google.se...? Or what top level domain a site with the domain name rumpelstiltskin uses?
Adrianthelibrarian
Thank you so much Pandy, I will try this out straight away. By running the script I hope to find domains that a word is not being used, or the use of a similar named site with a different top level domain. I wanted to find a cheap domain that was had very few letters because my previous one took too long to spell out. A three or four letter domain would be much easier for explaining and when signing up my email smile.gif
thank you again. I will stay on the forum as i have much to learn
A
Christian J
QUOTE(Adrianthelibrarian @ Jul 1 2019, 04:59 AM) *

By running the script I hope to find domains that a word is not being used, or the use of a similar named site with a different top level domain. I wanted to find a cheap domain that was had very few letters because my previous one took too long to spell out.

Domain registrar companies may have a service like that.
pandy
Not only may. They do. It's called WHOIS.
https://en.wikipedia.org/wiki/WHOIS

Just google WHOIS and you'll find several services. And as said, just about any registrar. But if you are looking for a three letter dot com, I think you'll find that all are taken, even such as qzy. sad.gif

If you find some, buy them all. They are a good investment. wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.