Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Coding a url linked submit box

Posted by: Adrianthelibrarian Jun 30 2019, 06:28 PM

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

Posted by: pandy Jun 30 2019, 07:39 PM

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?

Posted by: Adrianthelibrarian Jun 30 2019, 09:59 PM

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

Posted by: Christian J Jul 1 2019, 04:16 AM

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.

Posted by: pandy Jul 1 2019, 05:51 AM

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

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)