473,382 Members | 1,329 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,382 software developers and data experts.

DropDownList validation

Hi
can anyone please help me.
i have two dropdownlists.one is for month and the other is for days.if i select any other month from the month dropdownlist the days in the second(days) dropdown should have upto 30(1,2,3......).if february is selected the the days should be only upto 28. how to do this
Aug 19 '08 #1
4 1480
r035198x
13,262 8TB
Which language are you using for that? You can do it in Javascript or in ASP.NET with (C# or VB). But even better is to just one of the thousands of ready made date pickers that are all over the internet.
Aug 19 '08 #2
tlhintoq
3,525 Expert 2GB
On the event of ListBoxMonth.SelectedIndexChanged go to a function that checks which month is selected, then populate the ListBoxDays.Items property with the right number of days.

Exactly how you do the populating is up to your programming style. Maybe you have a List with the number of days in each month {31,28,31...} then loop from 1-x adding the loop's index to the Day dropdown list. Maybe you do use a Switch construct (case "January"... case "February"...)
Aug 20 '08 #3
hibnnm;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Aug 21 '08 #4
r035198x
13,262 8TB
hibnnm;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In case you are feeling the urge to introduce yourself you should use the introduction forum for that.
Aug 21 '08 #5

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

Similar topics

2
by: Brennon Arnold | last post by:
I have a problem that I figured would be relatively common, but have been unable to find any information on it as of yet. I have a page that contains two DropDownList controls, with the second...
2
by: Wes Weems | last post by:
I'd like to have a 3 values in a drop down, and have a validator not allow a form submit unless its 2 of the 3 values (eg, one of the values says "select one") I used custom validator and did a...
5
by: Bryan Ax | last post by:
I have a page that has two copies of the same control in it. The control is: BorrowerControl the two references to it in the page are bControl1 cobControl1
1
by: Liz | last post by:
I have a page with several dropdownlists, several text boxes and several buttons which perform calculations. I need to validate one dropdownlist (not the whole page) with the click of one button. I...
0
by: eurorscg | last post by:
Hi, i have this dropdownlist that breaks xhtml w3c validation.because it generates a select tag with a javascript property. this only happens when autopostback is set to true. so the the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.