Is it correct to use DIV inside FORM?

demas picture demas · Mar 30, 2012 · Viewed 116.2k times · Source

I'm just wondering what are you thinking about DIV-tag inside FORM-tag?

I need something like this:

<form>
  <input type="text"/>
  <div> some </div>
  <div> another </div>
  <input type="text" />
</form>

Is it general practice to use DIV inside FORM or I need something different?

Answer

Royi Namir picture Royi Namir · Mar 30, 2012

It is totally fine .

The form will submit only its input type controls ( *also Textarea , Select , etc...).

You have nothing to worry about a div within a form.