0
数値フィールドの一意の数値のみを許可するjqueryスクリプトが必要です。Jqueryは、一意の制限付き数字の数値フィールドのみを許可します。
HTML
<input type="text" id="registration_number" class="input-sm" name="registration_number" maxlength="6" required>
私のjQueryのコードが機能していますが、私はまた、重複値をとります。
jQuery("#job_no").keypress(function(e) {
var verified = (e.which == 8 || e.which == undefined || e.which == 0) ? null : String.fromCharCode(e.which).match(/[^0-9]/);
if (verified || e.delegateTarget.value.length>3 || e.ctrlKey ==true) { if(e.which!=8){e.preventDefault();}}
}).on('paste',function(e){ e.preventDefault();});
私はこれをどうすればできますか?
誰かお手伝いください。
私はあなたの代わりに入力タイプ=「テキスト」を使用している理由を簡単に入力タイプ=「数」でこれを達成することができますし、長さのためにあなたが最小= 0とmax = 9999を提供することができます知りません。これは4桁以上を許可しません – Manish
あなたはユニークな意味ですか? – Styl