右键单击选中后复制提交后没有内容,大家帮下
运用红色代码部分的粘贴提交后没有内容,运用选中、复制、粘贴的方式提交后有内容?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="session.asp"-->
<!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" />
<link href="../css/all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="myconfig.js"></script>
<title>我的日记本</title>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from XType1",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("name"))%>","<%= rs("Did")%>","<%= rs("Xid")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{ //这句不是很理解
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<body>
<form name="myform" method="post" action="inputsave.asp">
<table width="100%" border="0">
<td colspan="2">选择分类 <%
rs.open "select * from DType1",conn,1,1
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%> <select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
<option selected value="<%=rs("Did")%>"><%=trim(rs("name"))%></option>
<% dim selclass
selclass=rs("Did")
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("Did")%>"><%=trim(rs("name"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
小类:
<select name="Nclassid">
<%rs.open "select * from XType1 where Xid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%>
<option selected value="<%=rs("XID")%>"><%=rs("name")%></option>
<% rs.movenext
do while not rs.eof%>
<option value="<%=rs("XID")%>"><%=rs("Name")%></option>
<% rs.movenext
loop
end if
rs.close
set rs = nothing
conn.Close
set conn = nothing
%>
</select><font color="#FF0000"> </font></td>
<tr>
<td align="right">标题
<input name="text" onClick="oCopy(this)" type="text" id="text" value="" size="60" /><script language="javascript">
function oCopy(obj){
obj.select();
js=obj.createTextRange();
js.execCommand("Copy")
alert("复制成功!");
} </script> </td>
</tr>
<tr>
<td> <script type="text/javascript">
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.Create() ;
</script></td>
</tr>
</table>
<table width="100" border="0">
<tr>
<td><input type="submit" name="Submit" value="提交" /> <input type="reset" name="Submit2" value="重置" /></td>
</tr>
</table>
</form>
</body>
</html>
[解决办法]
你的代码是可以运行的。但是不知道你是否想拿这个
- HTML code
<input name="text" onClick="oCopy(this)" type="text" id="text" value="" size="60" />