用parseInt()将其他值转换为整型数:var num = parseInt(document.MForm.textfield.value);
if(isNaN(num)) alert("无法转换为整型数!");
else alert("已成功转换为整型数:" + num);