Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Default Select List

Reply
Thread Tools

Default Select List

 
 
rn5a@rediffmail.com
Guest
Posts: n/a
 
      05-06-2007
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.

 
Reply With Quote
 
 
 
 
rn5a@rediffmail.com
Guest
Posts: n/a
 
      05-06-2007
On May 6, 6:31 am, (E-Mail Removed) 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.....

 
Reply With Quote
 
 
 
 
ThatsIT.net.au
Guest
Posts: n/a
 
      05-06-2007
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/dh...t/dropdown.asp

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.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.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
master select list changes contents of slave select lists Dan Thomas Ruby 0 02-02-2011 06:59 PM
to select random number from select list Pranjal Jain Ruby 3 04-10-2008 04:01 PM
Select List transfer to another List carrajo Javascript 5 02-17-2006 02:23 AM
modify the default option in a select changing another select WebRaster Javascript 1 10-26-2005 10:36 AM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments