工作中遇到的問題
當設type="number"時,"-"能輸入input框中但是提交數據時是空的
於是找到如下解決方式
座機input輸入框:
<input style="width:100px;" id="tel" type="text" onkeyup="value=value.replace(/[^\d\-\d]/g,'')" maxlength=20></input>
手機input輸入框:
<input style="width: 100px;" id="mobile" type="text" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11></input>