|
|
 |
February 22nd, 2009, 09:28 PM
|
#1
|
|
New Member
Join Date: Jan 2009
Location: Gold Coast, Australia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Text form field leads to URL?
Hi all
I have 26 folders inside a website, labelled 'a' to 'z'.
On the home page of the site I want a text form field, with a submit button.
If someone lands on the site's home page and types in eg j in the text form field, I want them to land on the 'j' folder home page
Does anyone know if a script like that is out there somewhere?
I can't google it because I can't figure out what search term to use
I hope someone can help
Cheers
Old John
|
|
|
February 23rd, 2009, 06:42 AM
|
#2
|
|
New Member
Join Date: Dec 2008
Location: South Africa
Age: 22
Posts: 31
Thanks: 2
Thanked 3 Times in 3 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
Are you specifically wanting to use JavaScript for this one?
|
|
|
February 23rd, 2009, 12:34 PM
|
#3
|
|
New Member
Join Date: Jan 2009
Location: Gold Coast, Australia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
I completely don't mind . . .
I'm an old print industry graphic designer who taught himself to use DW to make html pages.
I don't really know much more than that.
I just need to have a text field on the home page, and if someone types in a subdirectory name in that field and hits SUBMIT, it will take them to the subdirectory.
EXAMPLE: If they are in http://mydomain.com/index.html and they enter the word 'sample' (no quotes) in the text field and then they hit SUBMIT, they will then land on http://mydomain.com/sample/index.html
Cheers
John
|
|
|
February 25th, 2009, 01:54 AM
|
#4
|
|
WebForumz Member
Join Date: Jul 2007
Location: Australia
Age: 18
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
That's more PHP orientated then Javascript. I cant write up a full example for you now, but once i get home i'll help you out.
|
|
|
February 25th, 2009, 01:56 AM
|
#5
|
|
New Member
Join Date: Jan 2009
Location: Gold Coast, Australia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
Hey that'd be cool as mate . . . where abouts in Oz are you?
|
|
|
February 25th, 2009, 04:08 AM
|
#6
|
|
New Member
Join Date: Dec 2008
Location: South Africa
Age: 22
Posts: 31
Thanks: 2
Thanked 3 Times in 3 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
Quote:
Originally Posted by Evilaussie
That's more PHP orientated then Javascript.
|
I actually think it is quite possible to accomplish this with JavaScript. Unfortunately, i only know the basics of JS at this point, so i probably wouldn't be able to help with this 100%.
From my understanding of it, you would use the combination of a JS funtion and the search form to change the documents' url or src to the relevant value of the input field.
But that's just me... 
|
|
|
February 25th, 2009, 04:15 AM
|
#7
|
|
New Member
Join Date: Jan 2009
Location: Gold Coast, Australia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
Hey guess what someone sent me this from another forum, and it works!
<form>
<p align="center">Enter your code and click Submit.</p>
<div align="center">
<input type="text" name="letter" size="33">
<input type="button" value="Submit" name="B1"
onclick="document.location.href = letter.value + '/index. html'">
</div>
</form>
of course I don't know what language it is, but as long as it works, I'm cool
|
|
|
February 25th, 2009, 04:19 AM
|
#8
|
|
WebForumz Member
Join Date: Jul 2007
Location: Australia
Age: 18
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
Ah alright, glad to here it works! Yeah, i'm only familiar with PHP and the Javascript forum hasn't been to active lately, so i wasn't sure you would get help otherwise. Glad to hear it!
|
|
|
February 25th, 2009, 04:22 AM
|
#9
|
|
New Member
Join Date: Jan 2009
Location: Gold Coast, Australia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
Goodonyamate
Cheers
John
|
|
|
February 26th, 2009, 09:22 AM
|
#10
|
|
New Member
Join Date: Dec 2008
Location: South Africa
Age: 22
Posts: 31
Thanks: 2
Thanked 3 Times in 3 Posts
Rep Altering Power: 0
|
Re: Text form field leads to URL?
That looks like HTML to me and that's exactly what i was referring to here:
Quote:
Originally Posted by jono99
From my understanding of it, you would use the combination of a JS funtion and the search form to change the documents' url or src to the relevant value of the input field.
|
Glad you got it right now.
All the best for the rest of your work
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|