473,473 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Automatically set dropdown box values to system date

3 New Member
I have an ASP main page with date fields dropdown like

From date Date .. Month .....Year
To date Date.. Month..... Year

whenever i open mainpage.asp in the browser, i am needed to select the To & From dates. Instead of that i want the system date should be generated automatically in the dropdown boxes. Plz advice the code for this.
Sep 25 '07 #1
7 2283
dmjpro
2,476 Top Contributor
I have an ASP main page with date fields dropdown like

From date Date .. Month .....Year
To date Date.. Month..... Year

whenever i open mainpage.asp in the browser, i am needed to select the To & From dates. Instead of that i want the system date should be generated automatically in the dropdown boxes. Plz advice the code for this.
I think you should have posted the code in Asp Forum.
Actually no need to use JavaScript here.
Post the problem there and get the solution.

Kind regards,
Dmjpro.
Sep 25 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Do you want to use Javascript for this or ASP? You could use ASP to do it when generating the source for the page using the web server date or use Javascript after the page has loaded using the client's settings.
Sep 25 '07 #3
tabm2004
3 New Member
I think you should have posted the code in Asp Forum.
Actually no need to use JavaScript here.
Post the problem there and get the solution.

Kind regards,
Dmjpro.
Dear Dnjpro

Thanks for the reply.
can i attach the image of my page for better understanding.

Plz say how to attach the image in this post
Thanks
Sep 25 '07 #4
tabm2004
3 New Member
Do you want to use Javascript for this or ASP? You could use ASP to do it when generating the source for the page using the web server date or use Javascript after the page has loaded using the client's settings.
Thanks for the reply.
I have six drop down boxes for

FromDATE & FromMONTH & fromYEAR

ToDATE & ToMONTH & ToYEAR

In this dropdown i have listed 15 year period from 2003 onwards.

My requirement is whenever i open the page. I want corresponding date month & year should appear in these dropdown boxes.

Presently I am seeing 2003 as year in the dropdown.

I hope you have understood my problem.

Plz help
Sep 25 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
Plz say how to attach the image in this post
Edit your post within one hour and you should see an option to attach an image.
Sep 25 '07 #6
acoder
16,027 Recognized Expert Moderator MVP
My requirement is whenever i open the page. I want corresponding date month & year should appear in these dropdown boxes.

Presently I am seeing 2003 as year in the dropdown.

I hope you have understood my problem.
Use the option selected attribute to pre-select an option, e.g. if you have:
[HTML]<option value="2003">2003
<option value="2004">2004
<option value="2005">2005
<option value="2006">2006
<option value="2007">2007[/HTML] set 2007 as the selected option by:
[html]<option value="2007" selected>2007[/html]
Sep 25 '07 #7
acoder
16,027 Recognized Expert Moderator MVP
Added more information to the thread title to better describe the problem.
Sep 25 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Xerxes | last post by:
Hi, can I have a field automatically clicked by calling something like click()? I have a dropdown box, one of whose elements is "Others (Please Specify)". I list the dropdown boxes values...
4
by: Irishmaninusa | last post by:
I am trying to populate a drop down on a form with the contents of a recordset and I am getting the following values in the dropdown System.Data.DataRowView and not the expected content that...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
3
by: devNorway | last post by:
I have been struggling with a problem for days now, and searched for related problems and solutions but had no luck. I have two dropdown listboxes where the first is populated in page load and...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
0
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
5
by: Jeff User | last post by:
Hi all The date values in my dropdown list appear as mm/dd/yyyy Specifically, the day always contains 2 digits. I need to set the selected index of the dropdown to the date that equals another...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.