获取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="200px; overflow-y:visible; margin-top:30px; display:none " /> </textarea>