0

I am pulling my hair out due to this VERY weird behaviour I am seeing. I hope it's not something obvious I have overlooked or I will shoot myself in the knee.

Check out this fiddle. https://jsfiddle.net/Eristen/eqckdzjx/3/

What you won't notice right away is that the browser engine for some reason deletes this form element.

<form class="form-row" id="what-the-hell">
  ...
</form>

It doesn't remove it along with its contents, it just removes the element tags without touching the contents, thus ending up with the vertically aligned form groups instead of horizontally aligned as it should.

Now what is even weirder is that when I add this entire element dynamically with jQuery it actually leaves it as it is, without removing it and the inside elements align horizontally as they should (since it's a row layout element, that's its purpose).

So what am I missing here?

edit: It appears nesting forms is not allowed, although my code works when dynamically nesting them.

guru_laghima
  • 49
  • 1
  • 7
  • 1
    [Duplicate](https://google.com/search?q=site%3Astackoverflow.com+html+nested+form+tag+removed) of [Can you nest html forms?](https://stackoverflow.com/q/379610/4642212). You cannot nest [`
    `](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) tags. Please [validate your HTML](https://html5.validator.nu/).
    – Sebastian Simon Mar 16 '21 at 13:25
  • well I'll be damned, didn't even know these validators existed, thanks. so what do you think is the reason this works with dynamically adding it? – guru_laghima Mar 16 '21 at 13:30

0 Answers0