form inside table
P粉916553895
P粉916553895 2023-08-17 10:16:22
0
2
488

I have included some forms in an HTML table for adding new rows and updating the current row. The problem I'm having is that when I inspect the form in the dev tools, I see that the form elements close immediately after opening (input boxes etc. are not contained within the form).

Therefore, the field cannot be included when submitting the form.

The table rows and input boxes are as follows:

 

Any help would be great, thank you.

P粉916553895
P粉916553895

reply all (2)
P粉826283529

If you want to save your markup, use the"form" attribute:

(*Form fields outside the

tag)

    P粉459440991

    A form is not allowed as a child element oftable,tbodyortr. Attempting to place the form in these locations will cause the browser to move the form behind the table (while preserving its contents - table rows, table cells, input boxes, etc.).

    You can place the entire table within a form. You can place a form inside a table cell. But you cannot place part of a table inside a form.

    Use a form around the entire table. The clicked submit button can then be used to determine which rows to process (to increase speed), or to process each row (to allow batch updates).

    HTML 5 introducesformattribute. This allows you toprovide a form for each row outside of thetable, and then use itsidto associate all form controls in a given row with one of the forms.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!