<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> </title>
<style type="text/css">
</style>
<script type="text/javascript">
function setPrice(selObj){
document.forms['f1'].price.value = selObj.options[selObj.options.selectedIndex].value;
}
</script>
</head>
<body>
<form name='f1'>
<select name="category" onchange='javascript: setPrice(this);'>
<option value=''>Select an option</option>
<option value="41">Men</option>
<option value="39">Women</option>
<option value="20">Under 18's</option>
</select>
<input name="price" type="hidden" value="" />
</form>
</body>
</html
代码是否有任何问题,因为我没有在隐藏字段中看到更新值?