Default Select List

Default Select List

am 06.05.2007 03:31:49 von rn5a

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.

Re: Default Select List

am 06.05.2007 03:37:06 von rn5a

On May 6, 6:31 am, r...@rediffmail.com 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.....

Re: Default Select List

am 06.05.2007 17:40:55 von me

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:1178415109.779424.239470@p77g2000hsh.googlegroups.com.. .
> 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.
>