Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a two texboxes on textbox were the user should type (From Month)(as string) and second textbox (To Month) but i want to validate the textboxes so the user only can write in Januari,februari,march and so an? is there any expression to do that?
Posted
Comments
Zoltán Zörgő 27-Apr-13 17:20pm    
First question: Web Forms, Windows Forms, WPF, Silverlight... or what platform do you use?
Kurac1 27-Apr-13 17:21pm    
Asp, SharePoint

You could take a look at some of the Regular Expression tools here on this site:
Expresso - A Tool for Building and Testing Regular Expressions[^]
Regular Expression Library Builder[^]
Regular Expression Tester[^]

This sould be engough for your purposes, however Id use normal String maipulation or a combobox if I were you.
 
Share this answer
 
You mean ASP.NET.
Why don't you give the user a dropdown instead of a textbox, anyway?

Still, you can user regular expression validator[^]. The expression in your case is a simple enumeration: ^(january|february|march|and so on)$
Of use custom validator[^] and validate from code against an array
 
Share this answer
 
Comments
Ian A Davidson 27-Apr-13 20:28pm    
+5. Yes, a dropdown box would make more sense. Possibly even a date picker (which I believe will automatically adjust to the user's language). But the links provided, and the example expression, if they must stick to the regular expression method, also look helpful.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900