473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Default Select List

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 '07 #1
2 3305
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.....

May 6 '07 #2
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

<rn**@rediffmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr 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.
May 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: deko | last post by:
I populate a drop-down list like this: echo "<select>"; foreach ( $ip_list as $var ) { echo "<option>"; echo $var; echo "</option>"; } echo "</select>";
2
by: iam247 | last post by:
Hi I have an ASP form which only includes an option list. The list is dynamically created but includes a default value, which is an instruction "Select a group". The code is shown at bottom....
1
by: Peter Bailey | last post by:
Thanks to the news group I can now clear a list box. The default value in properties of the combo is set to "please select a year". the code Me.CBDOSYear = Me.CBDOSYear.ItemData(0) however...
1
by: Null | last post by:
Hello -- Is there a way to prevent the autopostback of a drop down list if there is a "default" item in the list -- example, a drop down list where the first item says "Select One" and the...
5
by: Kris Rockwell | last post by:
Hello (again), I have gotten the dropdown list functionality to work through a few tricks (probably not the most efficient, but it works) but I am not sure how to set the default selected value....
2
by: rodchar | last post by:
Hey all, I have an asp.net page called default.aspx. when I visit this site i type in http://myDirectory/ because I know that the name default.aspx will be assumed. However, when i goto this...
0
by: Ryan Liu | last post by:
In a listview, I found it is pretty nice I can type a letter or more letter quickly to select the NEXT item which begin with that letter(s). But seems the first row, even not high lighted, always...
3
by: Ming | last post by:
I have two list box (A and B), and I have two buttons to move list items (options) from this box to the other.I have a submit button to submit the form. I know how to move items from A to B by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.