Selection from One SELECT changes selected option of another SELECT?

J

J. Hall

Hey dudes,

This must be easy, but I've struggled for a night now to get it working!

Basically, I want a system for a holiday site, whereby you select a FROM
date (a SELECT of 1-31), upon selecting a value from this SELECT it will
changed the currently selected option from a second SELECT (also populated
with 1-31), BUT it will first add 7 (i.e. days)...

....e.g. if I were to select '4' from the first dropdown, the second would
automatically go to '11'.

Other issues here though are of course the Month and Year dropdowns, should
the user select a START date that will mean the TO date would be in the
proceeding month, I need to automatically move the SELECT box of the TO
MONTH onto the next option?

Checkout the feature working here on www.lastminute.com - I even attempted
to look at their code, but its done via a series of complex functions, I
need something a little simpler.

Basically, I need a summary of how to change/read/alter selected for the
SELECT object, and although I've searched everywhere, I've turned up nothing
thats at all useful.

Appreciate your help!

Cheers, @sh
www.net-performance.com
 
J

Jeff Thies

Please someone? this must be simple!!

It's not simple, but not that complex either.

Why not post up what you have in comp.lang.javascript? This is a
javascript thing rather than html.

Roughly what you'll do (won't work without javascript) is getTime, add 7
days worth of mSec and then use getDate,getMonth and getYear to find the
values to set your rolldowns. There's tons of javascript date information
with a little Googling.

Cheers,
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top