blur后替换
<input type="text" name="market_price" id="market_price"
onblur="this.value=isNaN(this.value*1)?0:this.value*1"
maxlength="10"
value="<{if
$de.market_price}> <{$de.market_price}> <{else}> 0.00
<{/if}>"/> 元
输入asf.fi3 结果0
输入后立马替换
<input maxlength="8" id="amount" name="amount" type="text" value="<{$de.stock}>" onkeyup="value=value.replace(/[^d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^d]/g,''))"/>