Gossamer Forum
Home : Products : Gossamer Links : Discussions :

http:// when adding?

Quote Reply
http:// when adding?
I recently a write up on my new search site from a Canadian hosting company. The article is included below:

Categories.ca: This search engine has a dmoz flavour to it and does pull some of it's content from there, but it is trying to build its own database of content and is looking for editors to help. Overall this SE looks good and has some additional nifty features to it. Submit by going to a category first and click on submit link. Remember to put http:// in front of your url.

Source: http://www.advancedhosting.ca/...ch_engine_canada.htm

The reason I am posting this message here, other than being proud of receiving this postive write-up, is that the last line of this article "Remember to put http:// in front of your url." alerted me to this:

I have received a couple of messages regarding the http:// part of address the user is adding.... the author of the above article sent me "I did have a problem trying to add www.advancedhosting.ca to the business>Internet category, URL can not contain the value 'www.advancedhosting.ca/' is the message I got. Please advise."

I would like to suggest that LSQL (or if someone could tell me how to make this mod) checks to see if the http:// is present or not, and add it if missing. My form does come up with the http:// already in the text box... but I think when some people cut and paste thier URL, they are doing so without the http://. I complelty understand this. Why IE even lets you do it in its address bar, so the un-educated thinks its ok.

ThanksWink

Quote Reply
Re: [sooke] http:// when adding? In reply to
Javascript is probably your best bet, with a verification of the field on submission. I'm no expert on this, but I'm pretty sure it could be done.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [sooke] http:// when adding? In reply to
As the form is submitted you could do something like:

Code:
<form ... onsubmit="validate();">

function validate() {
if (! form_name.URL.value.match(/^http:\/\//)) {
form_name.URL.value = "http://" + form_name.URL.value;
}
}

Last edited by:

Paul: Apr 16, 2002, 12:04 PM
Quote Reply
Re: [Paul] http:// when adding? In reply to
Thanks both!

Javascript it is then..... thanks for the code Paul. Smile
Quote Reply
Re: [Paul] http:// when adding? In reply to
I tried the javascript, but couldn't get it to work. I also tried it with:

Code:
form ... onsubmit="JAVASCRIPT:validate();">

Still no luck... This is supposed to be set in ADD.HTML, correct?

Sean
Quote Reply
Re: [SeanP] http:// when adding? In reply to
I'm assuming you removed the ... and changed accordingly? Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [SeanP] http:// when adding? In reply to
yeah add.html

Did you add a form name and change form_name to that name?

eg....

<form name="addform" action="<%db_cgi_url%>/add.cgi" method="POST" onsubmit="validate();">

Then the code should be:

addform.URL.value instead of form_name.URL.value

Last edited by:

Paul: Apr 16, 2002, 2:42 PM
Quote Reply
Re: [Paul] http:// when adding? In reply to
You're right. My bad. Thanks for the help!

Sean

Last edited by:

SeanP: Apr 16, 2002, 2:46 PM