关于div嵌套form,套不住的问题

关于div嵌套form,套不住的问题,第1张

你这嵌套的标签中有些是可以省略的,div单独使用是无效的,只有配合CSS才出效果,其中form外有a标签是何用意;如果你定义的HTML文档类型为为过渡(也有说传统)型或者严格型它对标签嵌套是有要求的不会像HTML40那样松散

<script>

documentquerySelector('#textfield')value=documentquerySelector('#yuan')getAttribute('title')

</script>

var b = absdocumentgetElementById("input");

这句本来就写错了 documentgetElementById("input"); 是获取ID 为 input 的元素getElementsByTagName("input") 才是获取 所有input 的元素 而且获取的是一个数组 你也不能 if(formbvalue == "") 这么直接进行比较 推荐你使用 jquery 来获取HTML节点应该方便很多$("input") 就可以选取所有的input了

那要看你submit哪个form罗。

如果你要传回下面的form的input的话,你应该submit下面的form,不是上面的。

如果你要submit上面的form的时候,一拼把下面的form的资料也一起传回,那你得用javascript帮忙,不是单单靠python就可以做得到。在submit上面的form的时候,你要先用javascript把下面的form的input value抄写一份到上面的form,然後submit时,所有资料都会齐全

asp是不能直接获取div内容的 不过可以通过js间接过去 代码如下,放到body之间 运行,本人亲测通过

<%

action_get = RequestQueryString("action")

IF action_get = "seeit" Then

ResponseWrite("序号:"&RequestForm("id")&"<br/>")

ResponseWrite("标准物质名称:"&RequestForm("mc")&"<br/>")

ResponseWrite("规格型号:"&RequestForm("xh")&"<br/>")

ResponseWrite("单位:"&RequestForm("dw")&"<br/>")

ResponseWrite("数量:"&RequestForm("sl")&"<br/>")

ResponseWrite("供应商:"&RequestForm("gy")&"<br/>")

End IF

%>

<script language="javascript">

function initData()

{

documentgetElementById("id")value=documentgetElementById("id1")innerHTML;

documentgetElementById("mc")value=documentgetElementById("mc1")innerHTML;

documentgetElementById("xh")value=documentgetElementById("xh1")innerHTML;

documentgetElementById("dw")value=documentgetElementById("dw1")innerHTML;

documentgetElementById("sl")value=documentgetElementById("sl1")innerHTML;

documentgetElementById("gy")value=documentgetElementById("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>

以上就是关于关于div嵌套form,套不住的问题全部的内容,包括:关于div嵌套form,套不住的问题、怎样获取form表单input里title的值,获取后,显示在div下input下value选定值里。。。求完整代码。、JS获取DIV下的所有input等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9776157.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-01
下一篇2023-05-01

发表评论

登录后才能评论

评论列表(0条)

    保存