求ASP获取DIV值,在jsxs.asp中如何写代码,谢谢!
<formaction="jsxs.asp"name="ghform"method="post"><tablewidth="800"bordercolor="#FFFF0...
<form action="jsxs.asp" name="ghform" method="post">
<table width="800" bordercolor="#FFFF00" height="280" border="1" align="center" cellpadding="0" cellspacing="0" style= "margin:0 ">
<THEAD>
<tr height="30"><th colspan="6" align="center">物质更换记录</th></tr>
<tr height="30">
<th width="35">序号</th>
<th>标准物质名称</th>
<th>规格型号</th>
<th>单位</th>
<th>数量</th>
<th>供应商</th>
</tr>
</THEAD>
<TBODY>
<tr>
<th width="80"><DIV id="id1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 123</DIV> </th>
<th width="200"><DIV id="mc1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 456 </DIV> </th>
<th width="200"><DIV id="xh1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 789</DIV> </th>
<th width="120"><DIV id="dw1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 987</DIV> </th>
<th width="80"><DIV id="sl1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 654 </DIV> </th>
<th width="120"><DIV id="gy1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 432</DIV> </th>
</tr>
</TBODY>
</table>
<p></p>
<p></p>
</table><p align="center"><input type="submit" value="提交" name="Submit" />
<input type="button" value="关闭" name="close" />
</form> 展开
<table width="800" bordercolor="#FFFF00" height="280" border="1" align="center" cellpadding="0" cellspacing="0" style= "margin:0 ">
<THEAD>
<tr height="30"><th colspan="6" align="center">物质更换记录</th></tr>
<tr height="30">
<th width="35">序号</th>
<th>标准物质名称</th>
<th>规格型号</th>
<th>单位</th>
<th>数量</th>
<th>供应商</th>
</tr>
</THEAD>
<TBODY>
<tr>
<th width="80"><DIV id="id1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 123</DIV> </th>
<th width="200"><DIV id="mc1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 456 </DIV> </th>
<th width="200"><DIV id="xh1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 789</DIV> </th>
<th width="120"><DIV id="dw1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 987</DIV> </th>
<th width="80"><DIV id="sl1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 654 </DIV> </th>
<th width="120"><DIV id="gy1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 432</DIV> </th>
</tr>
</TBODY>
</table>
<p></p>
<p></p>
</table><p align="center"><input type="submit" value="提交" name="Submit" />
<input type="button" value="关闭" name="close" />
</form> 展开
3个回答
展开全部
asp是不能直接获取div内容的 不过可以通过js间接过去 代码如下,放到body之间 运行,本人亲测通过
<%
action_get = Request.QueryString("action")
IF action_get = "seeit" Then
Response.Write("序号:"&Request.Form("id")&"<br/>")
Response.Write("标准物质名称:"&Request.Form("mc")&"<br/>")
Response.Write("规格型号:"&Request.Form("xh")&"<br/>")
Response.Write("单位:"&Request.Form("dw")&"<br/>")
Response.Write("数量:"&Request.Form("sl")&"<br/>")
Response.Write("供应商:"&Request.Form("gy")&"<br/>")
End IF
%>
<script language="javascript">
function initData()
{
document.getElementById("id").value=document.getElementById("id1").innerHTML;
document.getElementById("mc").value=document.getElementById("mc1").innerHTML;
document.getElementById("xh").value=document.getElementById("xh1").innerHTML;
document.getElementById("dw").value=document.getElementById("dw1").innerHTML;
document.getElementById("sl").value=document.getElementById("sl1").innerHTML;
document.getElementById("gy").value=document.getElementById("gy1").innerHTML;
return true;
}
</script>
<form action="?action=seeit" name="ghform" method="post" onsubmit="return initData();">
<table width="800" bordercolor="#FFFF00" height="280" border="1" align="center" cellpadding="0" cellspacing="0" style= "margin:0 ">
<THEAD>
<tr height="30"><th colspan="6" align="center">物质更换记录</th></tr>
<tr height="30">
<th width="35">序号</th>
<th>标准物质名称</th>
<th>规格型号</th>
<th>单位</th>
<th>数量</th>
<th>供应商</th>
</tr>
</THEAD>
<TBODY>
<tr>
<th width="80"><DIV id="id1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 123</DIV> </th>
<th width="200"><DIV id="mc1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 456 </DIV> </th>
<th width="200"><DIV id="xh1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 789</DIV> </th>
<th width="120"><DIV id="dw1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 987</DIV> </th>
<th width="80"><DIV id="sl1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 654 </DIV> </th>
<th width="120"><DIV id="gy1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 432</DIV> </th>
</tr>
</TBODY>
</table>
<input name="id" type="hidden" id="id" value="" />
<input name="mc" type="hidden" id="mc" value="" />
<input name="xh" type="hidden" id="xh" value="" />
<input name="dw" type="hidden" id="dw" value="" />
<input name="sl" type="hidden" id="sl" value="" />
<input name="gy" type="hidden" id="gy" value="" />
<p></p>
<p></p>
</table><p align="center"><input type="submit" value="提交" name="Submit" />
<input type="button" value="关闭" name="close" />
</form>
<%
action_get = Request.QueryString("action")
IF action_get = "seeit" Then
Response.Write("序号:"&Request.Form("id")&"<br/>")
Response.Write("标准物质名称:"&Request.Form("mc")&"<br/>")
Response.Write("规格型号:"&Request.Form("xh")&"<br/>")
Response.Write("单位:"&Request.Form("dw")&"<br/>")
Response.Write("数量:"&Request.Form("sl")&"<br/>")
Response.Write("供应商:"&Request.Form("gy")&"<br/>")
End IF
%>
<script language="javascript">
function initData()
{
document.getElementById("id").value=document.getElementById("id1").innerHTML;
document.getElementById("mc").value=document.getElementById("mc1").innerHTML;
document.getElementById("xh").value=document.getElementById("xh1").innerHTML;
document.getElementById("dw").value=document.getElementById("dw1").innerHTML;
document.getElementById("sl").value=document.getElementById("sl1").innerHTML;
document.getElementById("gy").value=document.getElementById("gy1").innerHTML;
return true;
}
</script>
<form action="?action=seeit" name="ghform" method="post" onsubmit="return initData();">
<table width="800" bordercolor="#FFFF00" height="280" border="1" align="center" cellpadding="0" cellspacing="0" style= "margin:0 ">
<THEAD>
<tr height="30"><th colspan="6" align="center">物质更换记录</th></tr>
<tr height="30">
<th width="35">序号</th>
<th>标准物质名称</th>
<th>规格型号</th>
<th>单位</th>
<th>数量</th>
<th>供应商</th>
</tr>
</THEAD>
<TBODY>
<tr>
<th width="80"><DIV id="id1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 123</DIV> </th>
<th width="200"><DIV id="mc1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 456 </DIV> </th>
<th width="200"><DIV id="xh1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 789</DIV> </th>
<th width="120"><DIV id="dw1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 987</DIV> </th>
<th width="80"><DIV id="sl1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 654 </DIV> </th>
<th width="120"><DIV id="gy1" CONTENTEDITABLE STYLE= "height: 100%; width: 100%; "> 432</DIV> </th>
</tr>
</TBODY>
</table>
<input name="id" type="hidden" id="id" value="" />
<input name="mc" type="hidden" id="mc" value="" />
<input name="xh" type="hidden" id="xh" value="" />
<input name="dw" type="hidden" id="dw" value="" />
<input name="sl" type="hidden" id="sl" value="" />
<input name="gy" type="hidden" id="gy" value="" />
<p></p>
<p></p>
</table><p align="center"><input type="submit" value="提交" name="Submit" />
<input type="button" value="关闭" name="close" />
</form>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不知道你要获取的是什么东西,要的效果是怎么样的,能说详细点嘛?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
通过js获取
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询