index 页面中<form name="form7" method="post" action="jieshou.asp"><input name="UName" type="text" /><textarea id="Content" name="Content" style="display:none"></textarea><iframe ID="Editor" name="Editor" src="newEditor/HtmlEditor_new/index.html?ID=content" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:335px;width:600px"></iframe><input name="submit" type="submit" value="提交"></form>jieshou页面中可以接收到 request.form("UName")和request.form("Content") 的值而换成<script language="javascript"> function XXX() { document.form7.submit(); }</script><form name="form7" method="post" action="jieshou.asp"><input name="UName" type="text" /><textarea id="Content" name="Content" style="display:none"></textarea><iframe ID="Editor" name="Editor" src="newEditor/HtmlEditor_new/index.html?ID=content" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:335px;width:600px"></iframe><input name="button" id="tijiao" type="button" value="提交" onclick="XXX()"></form>jieshou页面中可以接收到 request.form("UName") 的值 而request.form("Content") 的值 就一直是空值了谁能告诉我JS和按钮 提交表单有什么区别?楼下的回答的很详细,但是能告诉我我贴出来的代码用JS提交的能不能取到request.form("Content") 的值呢
谁能告诉我JS和按钮 提交表单有什么区别?答:区别不大,如果直接用<input type="submit" name="button">这就是一个内置的用于提交表单的按钮,我们一般用这样按钮会很方便的,但是它有个特点是它提交表单的时候是不能经过表单的验证的(用js可以帮它验证)。而js来提交表单<input name="button" id="tijiao" type="button" value="提交" onclick="XXX()"> 这里的type="button",就是普通的按钮而已,它要实现提交表单的功能则必须用到js来实现,那么xxx()就是帮它实现的js函数了。在xxx()中document.form7.submit(); 可以得到只等表单的提交,这里的表单是form7进行提交,其实form7也就是当前的表单了,因为name="form7"QQ群:58325541