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

textbox validation

Hi,

i have two textboxes one for month(2digits) and one for year(4digits).

i want to validate them so users cannot input dates in past. what would be a better way of doin this.

ps. i am a newbie

thanks
May 29 '08 #1
6 963
Curtis Rutland
3,256 Expert 2GB
Is this ASP.NET, or a windows forms application? You'll handle it differently depending on the situation.

Hi,

i have two textboxes one for month(2digits) and one for year(4digits).

i want to validate them so users cannot input dates in past. what would be a better way of doin this.

ps. i am a newbie

thanks
May 29 '08 #2
I am using windows forms application
May 29 '08 #3
Anyone can help???????
May 30 '08 #4
CyberSoftHari
487 Expert 256MB
Expand|Select|Wrap|Line Numbers
  1. if(Convert.Int16(txtDay.text) <= DateTime.Now.Day && Convert.Int16(txtMonth.text) <= DateTime.Now.Month)
  2. {
  3. // True Part
  4. }
  5. else
  6. {
  7. //False part
  8. }
  9. }
DateTime.Now.Month and DateTime.Now.Day
May 30 '08 #5
with above i get this error, any solutions ??

System.StackOverflowException was unhandled
InnerException:

An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
Jun 3 '08 #6
Curtis Rutland
3,256 Expert 2GB
System.StackOverflowException comes from too many nested method calls. You probably have either an infinite loop or infinite recursion somewhere in your program. Look for that. If you can't find it, you'll have to post some of your code.

with above i get this error, any solutions ??

System.StackOverflowException was unhandled
InnerException:

An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
Jun 3 '08 #7

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

Similar topics

2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
1
by: Kum | last post by:
Hi, I need help in asp.net dynamic textbox controls validation. I am creating textbox controls dynamically on a asp.net webpage. Now after creating the textboxes on the page I want to validate...
2
by: Oleg Ogurok | last post by:
Hi there, I have a modified ASP.NET TextBox control that formats its output as the phone number, e.g. if you enter "1234567890" it'll change the value to "123-456-7890". This is done by a...
14
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user...
1
by: bsm | last post by:
I have created one User controls which contains 1. Textbox and 2. ImageButton (to display calendar) (I tried to create my own datetime control). I have created "onblur" event on textbox event,...
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
2
by: Christian Cambier | last post by:
Hello, I have a textbox in which I only want to display numbers when the focus is set on the textbox and the user presses a key on the kb. Easy with html-control <input id="htmlTxtVal2"...
9
mageswar005
by: mageswar005 | last post by:
Hi Guys, My array textbox validation is not working fine,my code is given below please help me immediately. function validation() { var chks =...
2
by: mrutyunjaya | last post by:
hello, i have two textbox column and one button control in gridvie when i click button it will ask plese enter price in first textbox . when enter values it is asking again. how to pass...
4
by: HenrikL | last post by:
Hi. I have a textbox that have a binding on it with converter and validationrules. When a validation error ouccur the foreground of the textbox will change to red cause it has a style.triggers...
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:
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
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: 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
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
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...

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.