The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Coding a url linked submit box
Adrianthelibrarian
post Jun 30 2019, 06:28 PM
Post #1





Group: Members
Posts: 2
Joined: 30-June 19
Member No.: 26,920



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 30 2019, 07:39 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Adrianthelibrarian
post Jun 30 2019, 09:59 PM
Post #3





Group: Members
Posts: 2
Joined: 30-June 19
Member No.: 26,920



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 1 2019, 04:16 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,628
Joined: 10-August 06
Member No.: 7



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.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 1 2019, 05:51 AM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 06:39 AM