| | |
| | | <div class="clearfix layer-area" style="padding-bottom:15px;"> |
| | | <label class="text-right col-sm-3 col-md-3 control-label">纠错</label> |
| | | <div class="col-sm-9 col-md-9"> |
| | | <input class="form-control" id="Jiucuo" name="Jiucuo" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiucuo" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> |
| | | <input class="form-control" id="Jiucuo" name="Jiucuo" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiucuo" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="CheckNum(this);"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | parent.layer.close(index); |
| | | return false; |
| | | } |
| | | |
| | | //用户只能输入正负数与小数 |
| | | function CheckNum(obj) { |
| | | |
| | | if (isNaN(obj.value) && !/^-$/.test(obj.value)) { |
| | | obj.value = ""; |
| | | } |
| | | if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(obj.value)) { |
| | | obj.value = obj.value.replace(/\.\d{2,}$/, obj.value.substr(obj.value.indexOf('.'), 3)); |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |