tags:

views:

33

answers:

3
<script>
  function(form)
  {
     form.submit();
  }
</script>

<form action="do-1" id="frm1" method="post" >
   <form action="do-2" id="frm2" method="post" >
       <input type="submit" name="submit" value="submit" onclick="test(this.form)"
   </form>
</form>

someone tell me how to submit frm2 by js ?

i click and it always submit frm1 :(

Do it is impossible ?

A: 

That is completely invalid html, you can't nest forms in any version of html

jayrdub
thank for suggesstion
Chameron
+4  A: 

Per the W3C, you can't nest form tags.

Every form must be enclosed within a FORM element. There can be several forms in a single document, but the FORM element can't be nested.

I doubt browsers will consistently handle nested forms intuitively in your case. From my experience by accidentally nesting form tags, IE8 will not even render them properly, it causes many layout problems.

wsanville
thank for suggestions
Chameron
A: 

Try adding the word test after function?

Gabriel
^^ , mistake . i edited and have sample question like above
Chameron