Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 03-15-2005, 03:52 PM   #1 (permalink)
Crazy
 
[No idea] What's the best way to code a URL-generated from a form?

Hello,

I would like to create a URL link based on a pull-down menu on a website. There would be one pull-down menu for the month and another for the day. Example: they choose Feb 20, they would hit 'go' and they would be taken to the url:

www.mysite.com/index.php?day=20&month=02

What is the best way to do this? Javascript? PHP? Something else entirely?

Thank you.
TheProf is offline  
Old 03-15-2005, 04:11 PM   #2 (permalink)
Crazy
 
Location: Seattle, WA
PHP seems to make sense for this to me. But then, I've had my head buried in PHP for the past couple of weeks so I'm seeing it EVERYWHERE!
exizldelfuego is offline  
Old 03-15-2005, 06:21 PM   #3 (permalink)
Crazy
 
Location: Salt Town, UT
That would need to be done in javascript.

Shouldn't be too hard...

add unique "id" tags to everything in the form would be step 1, so you can easily grab your data from the fields.

I'm a little rusty with javascript (everything I write in javascript takes five times the amount of time it should), but here's the basic idea:

Code:
<form id="form_loc" name="loc">
Month: <select id="month" name="month">
<option value="01">Jan</option>
<option value="02">Feb</option>
</select><br>
Day: <select id="day" name="day">
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
</select><br>
<input type="submit" onClick="document.location = 'http://www.mysite.com/index.php?day=' + document.getElementById('day').value + '&month=' + document.getElementById('month'); return(false);">
</form>

That should get your user to the page.

But, if your url really looks like that, then you don't even need to mess around with javascript, creating a standard form and having it submit as a GET request will do the same thing.
Rawb is offline  
Old 03-30-2005, 08:29 AM   #4 (permalink)
Devils Cabana Boy
 
Dilbert1234567's Avatar
 
Location: Central Coast CA
java script or visual basic script

if you are using php pages, go with java, if you are doing asp, go with Visial Basic Script
__________________
Donate Blood!

"Love is not finding the perfect person, but learning to see an imperfect person perfectly." -Sam Keen
Dilbert1234567 is offline  
Old 03-30-2005, 09:03 PM   #5 (permalink)
Crazy
 
Location: here and there
Quote:
Originally Posted by Dilbert1234567
java script or visual basic script

if you are using php pages, go with java, if you are doing asp, go with Visial Basic Script
since this needs to be client side, only use vbscript if you only want your page to work on ie.
__________________
# chmod 111 /bin/Laden
theFez is offline  
 

Tags
code, form, idea, urlgenerated


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



All times are GMT -8. The time now is 03:31 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54