Date Dropdown entry - Adjusting number of days based on month

Discussion in 'ASP .Net Web Controls' started by wrecker, Feb 5, 2004.

  1. wrecker

    wrecker Guest

    Hi All,

    I'm just starting to create my first asp.net form and I require the
    user to enter a date. I've decided to go with three drop down lists
    to allow the user to enter the month, the day, and the year. Is there
    a way that I can dynamically adjust the number of days the user is
    allowed to choose from based on what month they pick? For example, if
    the user selects January the day dropdown will display 31 days (1
    through 31). If instead the users selects April, the day dropdown
    will only display 30 days.

    Is this easily accomplished? I guess the part that I'm concerned
    with causing the biggest problem is the updating of the page to change
    the dropdown range. Will the entire page have to reload or can I
    simple adjust that single control?

    Thanks for any help

    Rene
     
    wrecker, Feb 5, 2004
    #1
    1. Advertising

  2. Hi Rene,

    I'm just wondering why you don't just use a calendar control. It allows
    users to pick a date and as they select the month, it only shows the
    available days.

    Anyway, it sounds like you want to avoid postbacks, so you might be better
    off implementing this in client-side Javascript to make it dynamic.

    Ken

    <wrecker> wrote in message
    news:...
    > Hi All,
    >
    > I'm just starting to create my first asp.net form and I require the
    > user to enter a date. I've decided to go with three drop down lists
    > to allow the user to enter the month, the day, and the year. Is there
    > a way that I can dynamically adjust the number of days the user is
    > allowed to choose from based on what month they pick? For example, if
    > the user selects January the day dropdown will display 31 days (1
    > through 31). If instead the users selects April, the day dropdown
    > will only display 30 days.
    >
    > Is this easily accomplished? I guess the part that I'm concerned
    > with causing the biggest problem is the updating of the page to change
    > the dropdown range. Will the entire page have to reload or can I
    > simple adjust that single control?
    >
    > Thanks for any help
    >
    > Rene
     
    Ken Cox [Microsoft MVP], Feb 5, 2004
    #2
    1. Advertising

  3. wrecker

    Felbrigg Guest

    If your willing to postback to the server you can iterate throught the
    controls Items collection and remove individual items and or add them back
    in.

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Hi Rene,
    >
    > I'm just wondering why you don't just use a calendar control. It allows
    > users to pick a date and as they select the month, it only shows the
    > available days.
    >
    > Anyway, it sounds like you want to avoid postbacks, so you might be better
    > off implementing this in client-side Javascript to make it dynamic.
    >
    > Ken
    >
    > <wrecker> wrote in message
    > news:...
    > > Hi All,
    > >
    > > I'm just starting to create my first asp.net form and I require the
    > > user to enter a date. I've decided to go with three drop down lists
    > > to allow the user to enter the month, the day, and the year. Is there
    > > a way that I can dynamically adjust the number of days the user is
    > > allowed to choose from based on what month they pick? For example, if
    > > the user selects January the day dropdown will display 31 days (1
    > > through 31). If instead the users selects April, the day dropdown
    > > will only display 30 days.
    > >
    > > Is this easily accomplished? I guess the part that I'm concerned
    > > with causing the biggest problem is the updating of the page to change
    > > the dropdown range. Will the entire page have to reload or can I
    > > simple adjust that single control?
    > >
    > > Thanks for any help
    > >
    > > Rene

    >
     
    Felbrigg, Feb 5, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lord0
    Replies:
    1
    Views:
    574
    Thomas Weidenfeller
    Apr 19, 2006
  2. Bill
    Replies:
    10
    Views:
    741
    Fulvio
    Apr 13, 2006
  3. Replies:
    1
    Views:
    459
    Steve W. Jackson
    Dec 22, 2006
  4. Mufasa
    Replies:
    0
    Views:
    404
    Mufasa
    Sep 5, 2008
  5. VYAS ASHISH M-NTB837

    RE: Convert month name to month number faster

    VYAS ASHISH M-NTB837, Jan 6, 2010, in forum: Python
    Replies:
    0
    Views:
    621
    VYAS ASHISH M-NTB837
    Jan 6, 2010
Loading...

Share This Page