//To Check the given control contain only Alpha numeric values
function CheckKeyIsAlphanumerics(oControl)
{
if (/\W/.test(oControl.value))
{
alert("Please enter alphanumerics only");
oControl.value ="";
return false;
}
}
// Another way to validate this is
function CheckKeyIsAlphanumerics(oControl)
{
var regexNum = /\d/;
var regexLetter = /[a-zA-z]/;
if(!regexNum.test(oControl.value) !regexLetter.test(oControl.value))
{
alert('Type alphanumeric character');
return false;
}
}
//To Check the given control contain only Numeric Values
function CheckKeyIsNumerics(oControl)
{
if (/[^0-9]/.test(oControl.value))
{
alert("Please enter only numerics.");
oControl.value ="";
return false;
}
}
Captions
- Asp.Net (9)
- ASP.Net Tips (1)
- C# (7)
- Computer (1)
- Internet Explorer (5)
- Java Script (11)
- Shortcut Keys (4)
- SQL Programming - Common Mistakes (11)
- Sql Server (22)
- Sql Server Definitions (8)
- Sql Server Test (2)
- SSRS (2)
About Me
- Vasanth.S
- I'm just normal guy who like to travel, addicted to TV and Computer, Playing Computer Games and Watching Movies and many more. Have lot of idea and quote in life
My Blog List
-
-
Pass data from one page to another using post15 years ago