0
嗨,我有一个数字输入。 因此它在探险家中效果不错,因为它没有箭头。 和铬和更新的浏览器它没有照顾最大长度。检查数字交换javascript数字
<input type="text" id="amount2" name="quantity2" class="amountBox" value="0" onchange="ChangeSecondAmount(this.value)" maxlength="4" onkeypress="return /\d/.test(String.fromCharCode(((event||window.event).which||(event||window.event).which)));"/>
也许我可以改变onkeypress函数来检查数字的数量?
非常感谢。
但它没有帮助,因为我想让用户改变那个盒子 – Ruthie 2014-10-28 17:31:29