Hi Guys,
I have done code for that..this is the solution
$('#txtAddTags').keyup(function () {
var TotalTags = $('#txtAddTags').val().split(',');
if (TotalTags.length <= 20) {
for (var Index = 0; Index < TotalTags.length; Index++) {
if (TotalTags[Index].length <= 16) {
}
else {
alert('Max chars should be 16.');
TotalTags[Index] = TotalTags[Index].substr(0, TotalTags[Index].length - 1);
var TagValue = "";
for (var i = 0; i < TotalTags.length; i++) {
TagValue += TotalTags[i] + ","
}
TagValue = TagValue.substr(0, TagValue.length - 1);
$('#txtAddTags').val(TagValue);
return false;
}
}
}
else {
alert('Max tag should be 20.');
$('#txtAddTags').val($('#txtAddTags').val().substr(0, $('#txtAddTags').val().length - 1))
return false;
}
});