tags:

views:

39

answers:

4

Hi,

I want to know if there is any limitations on the number of form elements in a html page.

<form method="post" action="1.php">
<form> 
<input type="submit" action="2.php">
</form>
</form>

Is this valid?

+5  A: 

You shouldn't nest form elements, you can have multiple forms defined on a page however non-nested.

Be careful if you're using ASP.NET with WebForms, as they only allow the definition of a single form element.

Tim
+2  A: 

The number? No.

However, your example nests them, which is forbidden.

David Dorward
A: 

There is no limit to the number of form controls that can be included in a single page or <form>.

On the other hand, according to the HTML 4.01 Specification, nesting<form> elements is not allowed.

Jordan Ryan Moore
A: 

Nested forms are

  1. invalid
  2. a sign that you want to place business logic in html, which is generally the wrong approach

try to handle business logic on the server side. there you know which button was clicked and decide what to do.

Labuschin