28,390
社区成员
发帖
与我相关
我的任务
分享
<!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>
<title>弹窗选用户</title>
<meta name="keywords" content="弹窗选用户" />
<meta name="description" content="弹窗选用户" />
</head>
<script type="text/javascript">
function adduser(str){
var v=document.getElementById("user").value;
if(v.indexOf(","+str+",")==-1){
v+=str+",";
}else{
v=v.replace(","+str+",",",");
}
document.getElementById("user").value=v;
}
function add(){
window.open ('add.html', 'newwindow', 'height=200, width=200, top=30, left=30, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no');
}
</script>
<body>
<input type="text" size="30" name="user" id="user" readonly value="," />
<button type="button" onclick="add()">选择</button>
</body>
</html>
<!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>
<title>选择用户</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<script type="text/javascript">
function scs(str){
opener.adduser(str);
}
</script>
<body>
<ul>
<li onclick="scs('张三')">张三</li>
<li onclick="scs('李四')">李四</li>
<li onclick="scs('王麻子')">王麻子</li>
</ul>
<select onchange="scs(this.value)" name="user">
<option value="小强">小强</option>
<option value="小李">小李</option>
<option value="小謝">小謝</option>
</select>
</body>
</html>