drop down box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajeshkankran
    New Member
    • May 2007
    • 5

    drop down box

    Hi
    i m using drop down box containing list of months in one year.
    i want to select a month from drop down box,on the basis of the selection i want that it draw number of rows in a table equal to the number of days in that month.
    how can i do this?..
  • merseyside
    New Member
    • Mar 2007
    • 48

    #2
    Let's assume that there is a select-one list called theMonths. Create an array, lets call it monthDays, where each element is the number of days in that month, obviously taking into account leap years.

    On selecting the month, get the selected index from theMonths which should be the index for monthDays. Now with a for loop use that as the upper limit, applying insertRow(i) on the table element, where i is the loop counter. It may be necessary to delete rows from the table element too, otherwise the new rows will continue to be added.

    Comment

    Working...