Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
textbox validation: alphabet and numeric but always start with alphabet not numeric


What I have tried:

C#
textbox validation alphabet and numeric but always start with alphabet not numeric
Posted
Updated 10-Nov-16 12:25pm
Comments
Nelek 10-Nov-16 2:04am    
really...? You are asking people you don't know for help with that? No please, no thank you... no trace of effort in any way...

Good luck with it

You can use Regular Expression to solve your problem, head over to JavaScript RegExp Reference[^] and make some effort to learn. If you are stuck after trying, post your code here and ask for help.
 
Share this answer
 
Use a Regex:
C++
^[a-zA-Z]\w*$
should do it.
 
Share this answer
 
Comments
verma.vivek 10-Nov-16 2:18am    
I have not write any code. I am new, just want to validate.
Textbox accept numeric and alphabet, bur always start with alphabet.

show all code...
if (!val.match(/^[a-zA-Z]\w*$/)) {
$("#lblErrorMsgDatabaseDispatchers").text('');
$("#lblErrorMsgDatabaseDispatchers").text('Please ClientId Start with alphabet!!!');
$("#DIV_ValidationAlertError").css({ display: "block" });
return false;
}
else {
$("#lblErrorMsgDatabaseDispatchers").text('');
$("#DIV_ValidationAlertError").css({ display: "none" });
}

//// its work
 
Share this answer
 
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

Learn how to use the regular Expressions !
Here is a link to RegEx documentation:
perlre - perldoc.perl.org[^]
Here is links to tools to help build RegEx and debug them:
.NET Regex Tester - Regex Storm[^]
Expresso Regular Expression Tool[^]
This one show you the RegEx as a nice graph which is really helpful to understand what is doing a RegEx:
Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.[^]
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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