62,074
社区成员
发帖
与我相关
我的任务
分享
<script>
function select(val){
var txt=document.getElementById('txt');
if(txt.value.length==0){
txt.value=val;
}
else{
if(txt.value.indexOf(val)>-1){
alert('已选择此联系人');
}
else{
txt.value+=","+val;
}
}
}
function selecta(val){
var txt=document.getElementById('txta');
if(txt.value.length==0){
txt.value=val;
}
else{
if(txt.value.indexOf(val)>-1){
//alert('已选择此联系人');
}
else{
txt.value+=","+val;
}
}
}
</script>
<table>
<tr>
<td>
选择联系人:<br>
<select ondblclick='select(this.options[this.selectedIndex].text);selecta(this.options[this.selectedIndex].value);' style='width:100px;height:100px;' multiple="multiple">
<% ds = Fy_SqlParameter.GeneralcategoryB("select Fy_Collectibles.CollectionID,Fy_Collectibles.CollectionUsersId,Fy_Users.NickName from Fy_Collectibles inner join Fy_Users on Fy_Collectibles.CollectionUsersId=Fy_Users.UsersId where Fy_Collectibles.UsersId=@GcParameters", "36", "Int");
sl = ds.Tables[0].Rows.Count;
for (int i = 0; i < sl; i++)
{ %>
<option value='<%=ds.Tables[0].Rows[i]["CollectionID"].ToString() %>'><%=ds.Tables[0].Rows[i]["NickName"].ToString()%></option>
<%} %>
</select>
</td>
<td>
<input type='text' id='txt' />
<input type='text' id='txta' />
</td>
</tr>
</table>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<script>
function select(val){
var txt=document.getElementById('txt');
if(txt.value.length==0){
txt.value=val;
}
else{
if(txt.value.indexOf(val)>-1){
alert('已选择此联系人');
}
else{
txt.value+=","+val;
}
}
}
</script>
<table>
<tr>
<td>
选择联系人:<br>
<select ondblclick='select(this.options[this.selectedIndex].text);' style='width:100px;height:100px;' multiple="multiple">
<option text='A' value='1'>A</option>
<option value="2">B</option>
<option value="3">C</option>
<option value="4">D</option>
<option value="5">E</option>
<option value="6">F</option>
</select>
</td>
<td>
<input type='text' id='txt' />
</td>
</tr>
</table>
</BODY>
</HTML>