Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Is there any code where i can type in the name of a page into a text field ......
Old 10-23-2008, 12:57 PM Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
Hi,
Does anybody know a code where i can type the name of a page on my site in a text area, press a submit button and it will take me straight to that page.
For example, My site was in the code ( http://mysiteurl.com/ ), then when you type the name of the page into the text area and press submit, it will take you to that page ( http://mysiteurl.com/page )

Help would be much appreaciated .

Last edited by chrishirst; 10-23-2008 at 01:46 PM.. Reason: Silly formatting removed so the post is READABLE!
webmaster flex is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-23-2008, 01:44 PM Re: Is there any code where i can type in the name of a page into a text field ......
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Not with HTML. javascript or server side code.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-24-2008, 08:47 AM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
do you mean there is no code or you dont know one? I thought it would be a simple html!
webmaster flex is offline
Reply With Quote
View Public Profile
 
Old 10-24-2008, 09:15 AM Re: Is there any code where i can type in the name of a page into a text field ......
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
There's a couple different way to do it, though I've never thought about it. It is pretty simple, but definitely requires a server-side code, or else JavaScript, as Chris has pointed out. Why don't you bring it up in one of the other channels?
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 10-24-2008, 09:28 AM Re: Is there any code where i can type in the name of a page into a text field ......
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by webmaster flex View Post
do you mean there is no code or you dont know one? I thought it would be a simple html!
there is no "simple HTML" code that can do that.


the simplest javascript would be onblur="window.location.href = this.value" on the text input.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 10-24-2008 at 09:29 AM.. Reason: corrected my hastily typed syntax
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-24-2008, 10:31 AM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
Thanks ill give it a try
webmaster flex is offline
Reply With Quote
View Public Profile
 
Old 10-24-2008, 02:36 PM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
Do you know a full code, Im not too familiar with javascript, im still learning :-C
webmaster flex is offline
Reply With Quote
View Public Profile
 
Old 10-24-2008, 03:17 PM Re: Is there any code where i can type in the name of a page into a text field ......
RadGH's Avatar
Skilled Talker

Posts: 76
Name: Radley
Trades: 0
Demo: http://radgh.com/jsredir/redir/

Code:
<script type="text/javascript">
  function goto(url) {
    if (typeof(url) == undefined || url == '') { url = '../'; }
    window.location += url;
    return false; // Keep form from refreshing page
  }
</script>
<form onsubmit="return goto(this.gotoURL.value);">
	<input type="text" name="gotoURL" />
	<input type="submit" value="Go" />
</form>
Tested in IE6, FF2, and Google Chrome.
RadGH is offline
Reply With Quote
View Public Profile
 
Old 10-24-2008, 06:58 PM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
brilliant thanks radGH, thats exactly what i wanted. But is there any way i could pre-define the first part of the location, because it just adds the name of the page at the end of the current page its on eg (http://www.myurl/currentpage/pageIwanttogoto) instead of (http://www.myurl/pageIwanttogoto) so it doesent take me to that page.
webmaster flex is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 02:32 AM Re: Is there any code where i can type in the name of a page into a text field ......
RadGH's Avatar
Skilled Talker

Posts: 76
Name: Radley
Trades: 0
You could change the "window.location += url" to "window.location = 'http://website.com/'+url".
RadGH is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 06:06 AM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
great, that works perfectly!
but if the page typed in does'nt exist, how would i make i take you to another page, to tell them.
webmaster flex is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 06:59 AM Re: Is there any code where i can type in the name of a page into a text field ......
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by RadGH View Post
You could change the "window.location += url" to "window.location = 'http://website.com/'+url".
Just using "window.location = '/'+url" would have the same effect and make the script portable.

Quote:
Originally Posted by webmaster flex View Post
great, that works perfectly!
but if the page typed in does'nt exist, how would i make i take you to another page, to tell them.
Have a custom 404 page.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-25-2008, 09:08 AM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
I was thinking instead, of havin an alert when you press the submit button to tell you the page does'nt exist. How would i do this?

Last edited by webmaster flex; 10-25-2008 at 09:11 AM..
webmaster flex is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 09:13 AM Re: Is there any code where i can type in the name of a page into a text field ......
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you would have to use a xmlHTTPRequest (AJAX) to do that.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-25-2008, 03:29 PM Re: Is there any code where i can type in the name of a page into a text field ......
Decaf's Avatar
Ultra Talker

Posts: 489
Name: Adam
Trades: 0
PHP Code:
<?php
$sitename 
"YOUR SITE URL HERE NO END SHASH";
$linkname $POST["urlsuffix"];
if (
$linkname) {
      
header("$sitename/$linkname");
} else {
?><form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="text" size="25" name="urlsuffix" />
</form>
<?php 
}
?>
See if this works...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Old 10-25-2008, 04:04 PM Re: Is there any code where i can type in the name of a page into a text field ......
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The assumption there being the OPs site can use PHP
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-25-2008, 04:04 PM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
Your help is much appriciated decaf, but the host im with at the moment does'nt support php, so i wanted the code to be in javascript/html untill I get a new host
webmaster flex is offline
Reply With Quote
View Public Profile
 
Old 11-05-2008, 10:37 AM Re: Is there any code where i can type in the name of a page into a text field ......
Experienced Talker

Posts: 34
Trades: 0
The only way I have ever heard of such things is using a search with server-side code like PHP or .Net.
__________________

Please login or register to view this content. Registration is FREE
pingeyeg is offline
Reply With Quote
View Public Profile
 
Old 11-05-2008, 01:27 PM Re: Is there any code where i can type in the name of a page into a text field ......
Average Talker

Posts: 20
Trades: 0
have a look around proxy sites and view source?
__________________

Please login or register to view this content. Registration is FREE

sambo755 is offline
Reply With Quote
View Public Profile
 
Old 11-06-2008, 05:07 PM Re: Is there any code where i can type in the name of a page into a text field ......
webmaster flex's Avatar
Extreme Talker

Posts: 160
Name: Webmaster flex
Trades: 0
right im gonna try chrishirsts idea of having a custom 404 page then.
webmaster flex is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Is there any code where i can type in the name of a page into a text field ......
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.65210 seconds with 12 queries