Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old 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 johnwey is on a distinguished road
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
johnwey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 jono99 is on a distinguished road
Re: Text form field leads to URL?

Are you specifically wanting to use JavaScript for this one?
jono99 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 johnwey is on a distinguished road
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
johnwey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 Evilaussie is on a distinguished road
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.
Evilaussie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 johnwey is on a distinguished road
Re: Text form field leads to URL?

Hey that'd be cool as mate . . . where abouts in Oz are you?
johnwey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 jono99 is on a distinguished road
Re: Text form field leads to URL?

Quote:
Originally Posted by Evilaussie View Post
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...
jono99 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 johnwey is on a distinguished road
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
johnwey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 Evilaussie is on a distinguished road
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!
Evilaussie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 johnwey is on a distinguished road
Re: Text form field leads to URL?

Goodonyamate

Cheers

John
johnwey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 jono99 is on a distinguished road
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 View Post
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
jono99 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image behind an input field text box jono99 HTML, XHTML and CSS 7 December 13th, 2008 05:57 PM
making text field text disapear Phixon JavaScript 4 February 2nd, 2008 03:49 AM
Validating Input Text field Mallik Flash and ActionScript 1 June 11th, 2007 10:44 AM
Non-text field Validation NewDesigner JavaScript 6 November 24th, 2006 06:34 PM
validate text field to db field jtesolin Classic ASP 1 July 18th, 2006 01:48 PM


Search Engine Optimization by vBSEO 3.2.0 RC8