您现在的位置是:首页 > 电脑技术查询 > web开发

动态生成的表单怎么检测和提交

编辑:chaxungu时间:2022-10-02 23:23:20分类:web开发

动态生成的表单如何检测和提交?
在同一个页面上生成了多个层(除了名字不同外都是一样的)。
每层都是一个表单。
请问怎么样给表单取名才能检测表单和提交表单。




------解决方案--------------------
<script>
function formCheck(formName){
alert(formName);
return false;
}
</script>
<form name= "yourFromName " onsubmit= "formCheck(this.name);return false; " method= "post ">
<input type= "submit " value= "test ">
</form>
<form name= "yourFromName1 " onsubmit= "formCheck(this.name);return false; " method= "post ">
<input type= "submit " value= "test ">
</form>