Checking date past from 3 <SELECT> fields

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Astra

    #1

    Checking date past from 3 <SELECT> fields

    Hi Guys

    Can anybody advise me on how to check for a 'no later than today's date'
    value from 3 <SELECT> fields.

    I have 3 <SELECT> fields, which are one for the day, one for the month and
    one for the year. All are numeric, ie the day format is 1 not 01, the month
    format is 11 not Nov, the year format is 2004.

    I have done a bit of ASP to make these <SELECT> fields auto-SELECTED to
    today's date.

    What I want to check via a client-side script to make sure that when they
    click the Submit button, the date that they select is at least no later than
    today's date before the submit process can continue.

    Any ideas?

    Rgds

    Robbie



  • George Jempty

    #2
    Re: Checking date past from 3 &lt;SELECT&g t; fields

    Astra wrote:
    [color=blue]
    > Hi Guys
    >
    > Can anybody advise me on how to check for a 'no later than today's date'
    > value from 3 <SELECT> fields.
    >
    > I have 3 <SELECT> fields, which are one for the day, one for the month and
    > one for the year. All are numeric, ie the day format is 1 not 01, the month
    > format is 11 not Nov, the year format is 2004.
    >
    > I have done a bit of ASP to make these <SELECT> fields auto-SELECTED to
    > today's date.
    >
    > What I want to check via a client-side script to make sure that when they
    > click the Submit button, the date that they select is at least no later than
    > today's date before the submit process can continue.
    >
    > Any ideas?[/color]

    Create two date objects. One with no arguments will represent today.
    The other one you will pass the appropriate arguments from the dropdown.
    From the documentation at:



    The format for calling date in this way is as follows:

    new Date(yr_num, mo_num, day_num
    [, hr_num, min_num, sec_num, ms_num])

    So it looks like the first 3 arguments are the relevant ones for you,
    and the others are optional anyway.

    These Date() objects will return the number of milliseconds since time
    began sometime back in 1970 ;) Just do a boolean greater than/less than
    type comparison on them.

    Comment

    • Laphan

      #3
      Re: Checking date past from 3 &lt;SELECT&g t; fields

      Thanks George


      George Jempty <fleetwoodd@bel lsouth.net> wrote in message
      news:B7%0c.1762 0$6e7.7364@bign ews1.bellsouth. net...
      Astra wrote:
      [color=blue]
      > Hi Guys
      >
      > Can anybody advise me on how to check for a 'no later than today's date'
      > value from 3 <SELECT> fields.
      >
      > I have 3 <SELECT> fields, which are one for the day, one for the month and
      > one for the year. All are numeric, ie the day format is 1 not 01, the[/color]
      month[color=blue]
      > format is 11 not Nov, the year format is 2004.
      >
      > I have done a bit of ASP to make these <SELECT> fields auto-SELECTED to
      > today's date.
      >
      > What I want to check via a client-side script to make sure that when they
      > click the Submit button, the date that they select is at least no later[/color]
      than[color=blue]
      > today's date before the submit process can continue.
      >
      > Any ideas?[/color]

      Create two date objects. One with no arguments will represent today.
      The other one you will pass the appropriate arguments from the dropdown.
      From the documentation at:


      te.html#1193137

      The format for calling date in this way is as follows:

      new Date(yr_num, mo_num, day_num
      [, hr_num, min_num, sec_num, ms_num])

      So it looks like the first 3 arguments are the relevant ones for you,
      and the others are optional anyway.

      These Date() objects will return the number of milliseconds since time
      began sometime back in 1970 ;) Just do a boolean greater than/less than
      type comparison on them.



      Comment

      Working...