当前位置: 代码迷 >> JavaScript >> 动态生成的表单怎么检测和提交
  详细解决方案

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

热度:13   发布时间:2012-02-25 10:01:49.0
动态生成的表单如何检测和提交?
在同一个页面上生成了多个层(除了名字不同外都是一样的)。
每层都是一个表单。
请问怎么样给表单取名才能检测表单和提交表单。




------解决方案--------------------
<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>
  相关解决方案