Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it correct to use DIV inside FORM?

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?

like image 701
ceth Avatar asked Mar 30 '12 12:03

ceth


People also ask

Should I use form or div?

<form> is what you use to create a form for people to fill in. Div is used to divide sections of the web page up.

Can a form have multiple divs?

You can use multiple divs within a form, but you cannot close a parent before the child is closed.

Can I use div inside paragraph?

The <div> tag can NOT be inside <p> tag, because the paragraph will be broken at the point, where the <div> tag is entered. To apply styles inside a paragraph use <span> tag, which is used with inline elements.

Can we use div inside TD?

If you use a div in a td you will however get in a situation where it might be hard to predict how the elements will be sized. The default for a div is to determine its width from its parent, and the default for a table cell is to determine its size depending on the size of its content.


1 Answers

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.

like image 61
Royi Namir Avatar answered Oct 02 '22 13:10

Royi Namir