当不足3位时前面加0(客户端实现方法)
<script type="text/javascript">
function padLeft(str, pad, count) {
while(str.length<count)
str=pad+str;
return str;
}

function check(el) {
el.value=padLeft(el.value.replace(/^(\d\d)$/,"$1"), "0", 3);
}
</script>

<input type="text" onblur="check(this)">
参考资料:http://www.thescripts.com/forum/thread148223.html













参考资料:http://www.thescripts.com/forum/thread148223.html