Default Select List

Discussion in 'ASP General' started by rn5a@rediffmail.com, May 6, 2007.

  1. Guest

    During registration, users have to provide their date of birth. For
    the date & month part, there are 2 dropdown lists & for the year,
    there's a textbox. These 3 fields are finally merged together to
    populate a MS-Access database table in a column named DOB whose data
    type is Date/Time.

    There's another page named, say, MyPage.asp, in the same application
    where users have to again enter their date of birth. Like the
    registration page, here too there are 2 dropdown lists for the date &
    month part & a textbox for the year part.

    Assuming that a user has already registered, when he comes MyPage.asp
    (which again has the date of birth fields), I don't want to make the
    user enter the same info again. Rather I would retrieve his date of
    birth from the DB table & populate the 2 dropdown lists with the date
    & month & populate the textbox with the year.

    Assume that the user's date of birth is 22/10/1980 (dd/mm/yyyy
    format). Populating the year 1980 in the textbox is not a problem. The
    problem is how do I ensure that when this user comes to MyPage.asp,
    the date dropdown list selects 22 by default & the month dropdown list
    selects October by default.

    With what do I compare the date & month values that have been
    retrieved from the DB table so that the 2 dropdown lists select the
    correct option by default?

    Note that in the DB table, dates are in the same format as shown above
    but in the ASP page, the month dropdown list is populated with
    January, February, March, April, May etc. & not 1, 2, 3, 4, 5 etc.
     
    , May 6, 2007
    #1
    1. Advertising

  2. Guest

    On May 6, 6:31 am, wrote:
    > During registration, users have to provide their date of birth. For
    > the date & month part, there are 2 dropdown lists & for the year,
    > there's a textbox. These 3 fields are finally merged together to
    > populate a MS-Access database table in a column named DOB whose data
    > type is Date/Time.
    >
    > There's another page named, say, MyPage.asp, in the same application
    > where users have to again enter their date of birth. Like the
    > registration page, here too there are 2 dropdown lists for the date &
    > month part & a textbox for the year part.
    >
    > Assuming that a user has already registered, when he comes MyPage.asp
    > (which again has the date of birth fields), I don't want to make the
    > user enter the same info again. Rather I would retrieve his date of
    > birth from the DB table & populate the 2 dropdown lists with the date
    > & month & populate the textbox with the year.
    >
    > Assume that the user's date of birth is 22/10/1980 (dd/mm/yyyy
    > format). Populating the year 1980 in the textbox is not a problem. The
    > problem is how do I ensure that when this user comes to MyPage.asp,
    > the date dropdown list selects 22 by default & the month dropdown list
    > selects October by default.
    >
    > With what do I compare the date & month values that have been
    > retrieved from the DB table so that the 2 dropdown lists select the
    > correct option by default?
    >
    > Note that in the DB table, dates are in the same format as shown above
    > but in the ASP page, the month dropdown list is populated with
    > January, February, March, April, May etc. & not 1, 2, 3, 4, 5 etc.


    OK....I got it.....
     
    , May 6, 2007
    #2
    1. Advertising

  3. This is more a client side problem.

    But I will show you how.

    First I assume you can write your values to the client side script something
    like

    var dDay = '<%=dDay%>'

    assuming you know how to do this you then see how I have done this example
    http://dev.thatsit.net.au/Samples/dhtml/persist/dropdown.asp

    <> wrote in message
    news:...
    > During registration, users have to provide their date of birth. For
    > the date & month part, there are 2 dropdown lists & for the year,
    > there's a textbox. These 3 fields are finally merged together to
    > populate a MS-Access database table in a column named DOB whose data
    > type is Date/Time.
    >
    > There's another page named, say, MyPage.asp, in the same application
    > where users have to again enter their date of birth. Like the
    > registration page, here too there are 2 dropdown lists for the date &
    > month part & a textbox for the year part.
    >
    > Assuming that a user has already registered, when he comes MyPage.asp
    > (which again has the date of birth fields), I don't want to make the
    > user enter the same info again. Rather I would retrieve his date of
    > birth from the DB table & populate the 2 dropdown lists with the date
    > & month & populate the textbox with the year.
    >
    > Assume that the user's date of birth is 22/10/1980 (dd/mm/yyyy
    > format). Populating the year 1980 in the textbox is not a problem. The
    > problem is how do I ensure that when this user comes to MyPage.asp,
    > the date dropdown list selects 22 by default & the month dropdown list
    > selects October by default.
    >
    > With what do I compare the date & month values that have been
    > retrieved from the DB table so that the 2 dropdown lists select the
    > correct option by default?
    >
    > Note that in the DB table, dates are in the same format as shown above
    > but in the ASP page, the month dropdown list is populated with
    > January, February, March, April, May etc. & not 1, 2, 3, 4, 5 etc.
    >
     
    ThatsIT.net.au, May 6, 2007
    #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. Pranjal Jain
    Replies:
    3
    Views:
    183
    saras
    Apr 10, 2008
  2. Dan Thomas
    Replies:
    0
    Views:
    296
    Dan Thomas
    Feb 2, 2011
  3. palmiere
    Replies:
    1
    Views:
    473
    Erwin Moller
    Feb 9, 2004
  4. WebRaster
    Replies:
    1
    Views:
    293
    Francisco Spaeth
    Oct 26, 2005
  5. carrajo

    Select List transfer to another List

    carrajo, Feb 16, 2006, in forum: Javascript
    Replies:
    5
    Views:
    330
Loading...

Share This Page