<script type="text/javascript">
$(function(){
$("#id_new_password1").attr("maxlength",6); //控件的最大长度为6
});
});
function test(){
var password = document.getElementById('id_new_password1').value;
if (password.match(/\d/) && password.match(/[a-zA-Z]/ && password.length == 6)){
return true;
}
else{
alert("您输入的密码至少包含一个数字和一个字母!");
return false;
}
}
</script>