更新时间:2023-10-12 14:23:34
you could do it with javascipt with something like this :
<input onblur="checkLength(this)" id="groupidtext" type="text" style="width: 100px;" maxlength="6" />
<!-- or use event onkeyup instead if you want to check every character strike-->
function checkLength(el) {
if (el.value.length != 6) {
alert("length must be exactly 6 characters")
}
}
Note this would work in older browsers which don't support HTML 5, but relies on the user having javascript switched on.