1.

validation in jQuery to get only alphabets in textbox

Answer»

Below code will helps to APPLY validation on textbox which only accept ALPHABETS not any numeric or special character

$(function ()
{
$('#txtNumeric').KEYDOWN(function (e)
{
if (e.shiftKey || e.ctrlKey || e.altKey)
{
e.preventDefault();
}
else
{
var key = e.keyCode;
if (!((key == 8) || (key == 32) || (key == 46) || (key >= 35 && key &LT;= 40) || (key >= 65 && key <= 90)))
{
e.preventDefault();
}
}
}
);
});



Discussion

No Comment Found