Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you nest html forms?

Is it possible to nest html forms like this

<form name="mainForm">   <form name="subForm">   </form> </form> 

so that both forms work? My friend is having problems with this, a part of the subForm works, while another part of it does not.

like image 638
Levi Avatar asked Dec 18 '08 22:12

Levi


People also ask

Can we create nested form?

Using nested forms, we can create an array of objects within a single field and we can have an array of these fields. Hence, the nested form helps us manage large form groups and divides it into small groups. For example: A company decides to issue a form to collect data from users.

Can we have a form within a form?

You can't have a form within a form, so that's why it doesn't work.

How do you arrange a form in HTML?

Use the CSS text-align Property to Center a Form in HTML We can set the value to center to center the form. For example, apply the text-align property to the form tag in the style attribute, and set the property to center . Next, create input tags with the type text and then submit .


1 Answers

In a word, no. You can have several forms in a page but they should not be nested.

From the html5 working draft:

4.10.3 The form element

Content model:

Flow content, but with no form element descendants.

like image 127
Craig Avatar answered Oct 02 '22 16:10

Craig