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
Old 02-16-2007, 11:41 AM complete a url box
Junior Talker

Posts: 2
Trades: 0
I want to have a box on a web page where someone can type in a bit of text that would complete a url. For example

www.abc.com/blablabla=[ ]

Where the [ ] would be a box where a user could type, for example, car and press a button to go the the url

www.abc.com/blablabla=car

Any tips appreciated. I use Frontpage, BTW.
lobserve is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-16-2007, 01:26 PM Re: complete a url box
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
You would use java. Hook into some event, maybe onblur, and then use window.location=document.getElementById(textbox) to tell the browser to go there.

But why? We already have a url box.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 02-16-2007, 01:32 PM Re: complete a url box
memberpro's Avatar
Super Talker

Posts: 143
Trades: 0
I would create a userform with a hidden value that would hold the "www" part and then a field element for the "box".

When you hit submit you should have a simple program that would take the hidden field and add the value of the "box" field and then use simple redirect code to forward the user to the correct page.

Good Luck.
__________________

Please login or register to view this content. Registration is FREE
- step-by-step learn how to design, create and install your own website in hours...not days.
Please login or register to view this content. Registration is FREE
was never so easy.
memberpro is offline
Reply With Quote
View Public Profile
 
Old 02-16-2007, 01:40 PM Re: complete a url box
RanaD's Avatar
Super Talker

Posts: 139
Name: David
Trades: 0
I just have to ask what this is for, because it seems a strange thing to want to do.
RanaD is offline
Reply With Quote
View Public Profile
 
Old 02-18-2007, 09:58 AM Re: complete a url box
Junior Talker

Posts: 2
Trades: 0
Quote:
Originally Posted by memberpro View Post
I would create a userform with a hidden value that would hold the "www" part and then a field element for the "box".

When you hit submit you should have a simple program that would take the hidden field and add the value of the "box" field and then use simple redirect code to forward the user to the correct page.

Good Luck.
That is what I was thinking but I would need to know what the "simple program" consists of (my skills with forms are not very good). Any specific instructions here would be most appreciated.

The purpose of the box for me is so that users of my site do not need to remember the long url to get where they want to go, they only need to know a short bit they can enter in a box. More specifically, the url is to a survey php and the bit in the box they would type takes them to whatever survey they constructed.
lobserve is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 05:02 PM Re: complete a url box
memberpro's Avatar
Super Talker

Posts: 143
Trades: 0
here is a simple program written in PHP (i am assuming your are hosted on a linux server)

in your form you should set the action="simplelittlescript.php" and method = post
name the "box" field "newpage"

Here is the code for the simplelittlescript.php

Code:
<?  $newpage=$_POST['newpage']; /// this variable is from your textbox field named 'newpage'
 
if (file_exists($newpage)) {
 
header("Location:$newpage") ; }
 
 
 
?>
Enjoy
__________________

Please login or register to view this content. Registration is FREE
- step-by-step learn how to design, create and install your own website in hours...not days.
Please login or register to view this content. Registration is FREE
was never so easy.

Last edited by memberpro; 02-19-2007 at 05:06 PM..
memberpro is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 05:07 PM Re: complete a url box
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Quote:
Originally Posted by lobserve View Post
The purpose of the box for me is so that users of my site do not need to remember the long url to get where they want to go, they only need to know a short bit they can enter in a box. More specifically, the url is to a survey php and the bit in the box they would type takes them to whatever survey they constructed.
This is exactly what hyperlinks are for. Just use regular html.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 05:31 PM Re: complete a url box
memberpro's Avatar
Super Talker

Posts: 143
Trades: 0
Kind of like killing a fly with a bazooka... I agree...
__________________

Please login or register to view this content. Registration is FREE
- step-by-step learn how to design, create and install your own website in hours...not days.
Please login or register to view this content. Registration is FREE
was never so easy.
memberpro is offline
Reply With Quote
View Public Profile
 
Old 04-14-2008, 08:29 AM Re: complete a url box
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
Its pointless, but easily done.

The only thing you can't have is www.abc.com/blablabla=
it would have to be www.abc.com/blablabla?something=

Code:
<form name="form" method="get" action="http://www.abc.com/blablabla">
  http://www.abc.com/blablabla?name=<input name="name" type="text" id="textfield" size="8" />
</form>
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to complete a url box
 

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.36177 seconds with 12 queries