获取ID组件的值
var userid=document.getElementById(‘userid‘).value;
var cdkey=document.getElementById(‘cdkey‘).value;
提交前的检测
<form method="post" id="form2" onSubmit="return r_check()" > ………… </form>
<input name="gift_num" type="text" id=‘gift_num‘ onkeyup="value=value.replace(/[^\d]/g,‘‘)" onbeforepaste="clipboardData.setData(‘text‘,clipboardData.getData(‘text‘).replace(/[^\d]/g,‘‘))">
<textarea name="yj" cols="20" rows="4" id="code_con" style="width:200px; overflow-y:visible; margin-top:30px; display:none " /> </textarea>
时间: 2024-10-07 20:21:27