Javascript Code - form
Here's what I want to do:
Three drop down menus - month, day, year. Whatever the combination is it will link to a new page of images.
I'm not sure how to script this. I've been looking for a code all day of something similar but with no luck. I have a familiarity with JS so I'd be able to edit the code the way I need it.
Busy posted this at 21:17 — 8th November 2004.
He has: 6,151 posts
Joined: May 2001
Might be easier to do a on(submit)click as you wont know which order the date is enter dd/mm/yy - yy/mm/dd - mm/dd/yy ...
maybe something like:
-user chooses dates from drop downs and clicks submit
-code makes sure all three are entered (and are numbers if using get method)
-redirects to page.
how you do your pages (html/ss) I have know idea but if they are html, having them named something like yyyy/mm/dd-topic.html then you can add the date to the filename when submitted, if SS pages then similar or draw stuff from databse on that date
dthatsme posted this at 21:28 — 8th November 2004.
She has: 25 posts
Joined: Sep 2004
Thanks for the reply, Busy.
Yes, I want a submit button.
Here's an example of how I'd like it to look http://ads.butlereagle.com/staging/choose_date.html
Busy posted this at 21:54 — 8th November 2004.
He has: 6,151 posts
Joined: May 2001
As for the actually coding, Javascript is not one of my high points (in other words I suck at it ).
As your form has no blank options you should just beable to take the values from the form (month,day,year), put them into a variable and call it as your page. You may have to make the month values into number.
If you use the get method you also may want to do some checks on the receiving page, especialy if being pulled from database.
I've got PHP on the brain so I can only think of doing it in PHP at the moment - sorry.
Hopefully someone with some Javascript knowledge can help you with the rest, I could have a go but would probably get it wrong
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.