2007/3/13 星期二
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function change(e){
e.tx1.value=e.sel.options[e.sel.selectedIndex].value;
}
</script>
<script>
function cli(e){
alert(document.fo1.sel.options[document.fo1.sel.selectedIndex].value);
alert("不提交页面");
}
</script>
</head>
<body>
<form name="fo1">
<label>城市名</label>
<select name="sel" οnchange="change(document.fo1)">
<option selected="selected">请选择</option>
<option value="苏州">苏州</option>
<option value="南京">南京</option>
</select>
<label> 城市信息:</label>
<input type="text" name="tx1" value="" οnchange="change(document.fo1)"/>
<input type="submit" value="提交" οnclick="cli(document.fo1.tx1)"/>
</form>
</body>
</html>