<input type="radio" name="r1" value="10" />10 <br/> <input type="radio" name="r1" value="45" />45 <br/> <input type="hidden" name="sum" value="" />
例如,当用户单击一个按钮时,隐藏字段的值将更改为该值.
<input type="radio" name="r1" value="10" onClick="document.getElementById('hidfield').value=this.value"/>10 <br/> <input type="radio" name="r1" value="45" onClick="document.getElementById('hidfield').value=this.value"/> 45 <br/> <input type="hidden" name="sum" value="" id="hidfield" />