Is there a way to use a non-form-associated element as a natural member?

0

In HTML , there are Form-associated elements, which are elements that are associated with form input for example.

Well, but even if it is not usual, if in a given situation I want a NOT 'Form-associated' element to be associated with the form in question, something like:

<form>
   <div value="VALOR"></div>
</form>
  

Is it possible to associate these elements with HTML only? (submit the   div value)

NOTE: I do not want to capture the value with JS or otherwise, the question is whether there is any way to make these elements associated in a natural way with HTML .

    
asked by anonymous 18.03.2018 / 02:18

1 answer

1

The answer is no . Only form elements (input, textarea, select, button ...) are received in the backend via form .

If it is strictly necessary to send a value attribute of a div to a submit (which is not correct, since the value attribute does not apply to div s but to% form), you would have to do a control via JS by creating a input hidden and sending the value of the attribute to that input before submitting, so that the backend can receive it. >     

18.03.2018 / 02:30