Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Finder Script... 2

Status
Not open for further replies.

ColyHow

Technical User
Joined
May 26, 2006
Messages
2
Location
US
Please Forgive Me.

I am a web designer... I know XHTML and CSS and now am just started (literally) to learn JavaScript, so I do not know the terminology I Should use to search my query, let alone ask you all how to do it ...

so I will try and describe it here.

If there is a form that already talks about this please point me in that direction so I can get this site completed.

Thanks in advance...

Now the question...

I am developing a site... where users, lets call them owners, will be issued a number.

For this example lets say a number like HURR0001.

This number corresponds with a folder on the web server. So the number above would be so far everything is fine and easy...

The owner of the folder will advertise there number to people wanting to get information he has to offer in that folder. Here is the part I need help with…

Visitors will know to go to and that they will need to enter the number to get to the information.

The Site just mentioned will have a place (form field) with a label that says enter the page number here... The visitor simply then enters HURR0001 in the box and then the submit button…

Some JavaScript then adds that number to and subsequently takes them to the index page of the folder they entered in the field.

Now I know people can be told to just add the folder number to the domain name or when advertising they should advertise the whole URL… but as a way to promote the site we want people to see and explore other options as well as the folder they have the “code” for.

Does anyone know some JavaScript or have any suggestions?

Thanks
Jeff Biggs
Coly How
 
There are many ways of doing this... But this should give you a basic starting point:

Code:
<form>
	<input name="number" type="text">
	<input type="button" onclick="location = '[URL unfurl="true"]http://www.sitedomain.com/'[/URL] + this.form.elements['number'].value;">
</form>

You should probably have some server-side code in too for those with JS disabled, otherwise they will not be able to see the folders this way.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thank you Dan,

As a side note: What direction or script language, would you recommend taking that would offer the same functionality on a site for everyone... JS enabled or not...?

Jeff
 
It depends on what your web hosting service provides. ASP or PHP are the most common, depending on the operating system of the server - ASP for Windows, PHP for *nix. Since those are server side, neither makes a difference on the client-side browser's functionality.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top