Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to attach INPUT element to multiple forms?

Tags:

html

forms

Is it possible to attach an input element to more than one form? I know HTML5 allows you to specify a form an element belongs to by form's ID. But is it possible to attach it to like multiple ID's?

It seems nice to do all that without any javascript/JQuery, which is the alternative.

like image 461
xcorat Avatar asked Mar 24 '23 14:03

xcorat


1 Answers

No, a form control can be associated with only one form.

From w3c specification:

If a reassociateable form-associated element has a form attribute specified, then that attribute's value must be the ID of a form element in the element's owner Document.

You can use a single, large form and decide (on the server) which inputs to pay attention to based on which submit button was pressed.

like image 132
Quentin Avatar answered Apr 01 '23 05:04

Quentin