function test(){var num=document.Form1.MaxNum.value;var re=/^\d$|^[0-4][0-9]$|50/ig;if(num.match(re)==null){ alert('請輸入0-50的正整數'); return false;} document.Form1.submit() ;}orm