Reply
complete a url box
Old 02-16-2007, 11:41 AM complete a url box
Junior Talker

Posts: 2
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
 
When You Register, These Ads Go Away!
     
Old 02-16-2007, 01:26 PM Re: complete a url box
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,737
Name: John Alexander
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
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.
__________________
Membership Mastery Videos - step-by-step learn how to design, create and install your own website in hours...not days. Web Site Design 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
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
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
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
__________________
Membership Mastery Videos - step-by-step learn how to design, create and install your own website in hours...not days. Web Site Design 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
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,737
Name: John Alexander
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
Kind of like killing a fly with a bazooka... I agree...
__________________
Membership Mastery Videos - step-by-step learn how to design, create and install your own website in hours...not days. Web Site Design 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
Dead Like Me

Posts: 1,572
Name: Stefan
Location: London, UK
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>
Gilligan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to complete a url box
 

Thread Tools

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

vB 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.16271 seconds with 13 queries