Check the string to pattern like MSB/2006/00001
if (subject.match(/^MSB\/\d{4}\/\d{6}$/)) {}
Managing key board events
$(document).ready(function(){
$('.alphanum').keyup(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9:;,.-]/g,'');
});
$('.alphanum').blur(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9:;,.-]/g,'');
});
$('.alphanum-spl').keyup(function () {
this.value = this.value.replace(/[^A-Z0-9]/g,'');
});
$('.alphanum-spl').blur(function () {
this.value = this.value.replace(/[^A-Z0-9]/g,'');
});
$('.address').keyup(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9,-@._]/g,'').toUpperCase();
});
$('.address').blur(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9,-@._]/g,'').toUpperCase();
});
$('.ddo_suff').keyup(function () {
this.value = this.value.replace(/[^a-zA-Z0-9]/g,'').toUpperCase();
});
$('.ddo_suff').blur(function () {
this.value = this.value.replace(/[^a-zA-Z0-9]/g,'').toUpperCase();
});
});
if (subject.match(/^MSB\/\d{4}\/\d{6}$/)) {}
Managing key board events
$(document).ready(function(){
$('.alphanum').keyup(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9:;,.-]/g,'');
});
$('.alphanum').blur(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9:;,.-]/g,'');
});
$('.alphanum-spl').keyup(function () {
this.value = this.value.replace(/[^A-Z0-9]/g,'');
});
$('.alphanum-spl').blur(function () {
this.value = this.value.replace(/[^A-Z0-9]/g,'');
});
$('.address').keyup(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9,-@._]/g,'').toUpperCase();
});
$('.address').blur(function () {
this.value = this.value.replace(/[^a-zA-Z\s0-9,-@._]/g,'').toUpperCase();
});
$('.ddo_suff').keyup(function () {
this.value = this.value.replace(/[^a-zA-Z0-9]/g,'').toUpperCase();
});
$('.ddo_suff').blur(function () {
this.value = this.value.replace(/[^a-zA-Z0-9]/g,'').toUpperCase();
});
});
No comments:
Post a Comment