Last active
August 29, 2015 14:08
-
-
Save z007/87cf8fb984040402c1e1 to your computer and use it in GitHub Desktop.
下拉框值显示拒绝修改
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>下拉框值显示拒绝修改</title> | |
<script type="text/javascript"> | |
function inputText(){ | |
if (myForm.myCity.value == "") { | |
myForm.address.value = "您还没有选择"; | |
} | |
else { | |
myForm.address.value = "您来自:" + myForm.myCity.value; | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<form name="myForm" action="" method="get"> | |
请选择: | |
<select name="myCity" onchange="inputText()"> | |
<option value="">请选择</option> | |
<option value="北京">北京</option> | |
<option value="上海">上海</option> | |
<option value="广州">广州</option> | |
</select> | |
<input name="address" type="text" onchange="alert('您不能修改此处的文字')+inputText()"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment