Forum Moderators: coopster

Message Too Old, No Replies

populating drop down box

drop down box

         

ksugam

12:02 am on Feb 22, 2008 (gmt 0)

10+ Year Member



Hello all,
I have a PHP GET on a txtbox which takes input as yyyy/mm. Now i am thinking of changing this txt box into 2 drop down boxes, one for year and other for month.

Also, I want to populate the month box depending on what year is selected in the year box...

say for e.g., if user selects 2008 from year drop down, the month drop down should just have months jan and feb...
if user selects 2007 in the year drop down,thn month drop down will be jan to dec....
How to do this?

Looking forward to ur reply!

Merganser

1:48 am on Feb 22, 2008 (gmt 0)

10+ Year Member



I assume you are wanting to do this in PHP? PHP is a server side scripting language. The functionality you are wanting to create is client (browser) side. Thus, this can not be done with PHP, you will need javascript. You might try posting in an area of Webmasterworld dealing with java (you definately do not want my input on javascript).

Esqulax

4:24 pm on Feb 22, 2008 (gmt 0)

10+ Year Member



Definatly Javascript..
If you diddnt want to go down that route, but are ok to have seperate Year and month(no relationship) thats easily done in HTML.

henry0

4:28 pm on Feb 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This calls for Ajax so it's PHP+JS