Bonjour à tous,
Je viens de véifier une site sur W3C.
J'ai une table avec un 20ène de lignes. Chaque ligne correspond a ue information sur un échantillon. Et sur chaque ligne j'ai un bouton submit, pour modifier l'information de l'échantillon.
J'ai donc un formulaie par ligne. Ca ressemble a ceci:
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 <table id="listLables" class="table"> <thead> <tr> <th>id_label</th> <th>Glacier</th> <th>Location</th> <th>Type</th> <th>Replica</th> <th>Box</th> <th>is in</th> <th>is out</th> <th>is analized</th> <th>Comment</th> <th></th> </tr> </thead> <tbody> <form data-role="save-label" data-id="1" id="form-1" method="get"> <tr> <td>1 <input type="hidden" name="id" value="1"> </td> <td>GL1</td> <td>UP</td> <td>sDNA</td> <td>1A</td> <td> <select name="box-1"> <option id="1-2" value="2" > Box 1 </option> <option id="1-3" value="3" > Box 2 </option> <option id="1-4" value="4" > Box 3 </option> <option id="1-5" value="5" > Box 4 </option> <option id="1-1" value="1" selected> None </option> </select> </td> <td> <input class="sm-inp" type="number" min="0" max="1" id="isin-1" name="isin-1" value="0" /> </td> <td> <input class="sm-inp" type="number" min="0" max="1" id="isout-1" name="isout-1" value="0" /></td> <td> <input class="sm-inp" type="number" min="0" max="1" id="isanalized-1" name="isanalized-1" value="0" /> </td> <td> <input class="md-inp" type="text" id="comment-1" name="comment-1" value="" /> </td> <td> <input type="submit" id="submit-1" value="Save" /> </td> </tr> </form> <form data-role="save-label" data-id="2" id="form-2" method="get"> <tr> <td2 <input type="hidden" name="id" value="2"> </td> <td>GL1</td> <td>UP</td> <td>sDNA</td> <td>1A</td> [... suite des td ..] </tr> </form> </tbody> </table>
Quand je le passe sur W3C, j'ai ce message d'erreur
Je suis un peu surpris car j'ai vérifier mon code et il n'y a pas d'élément qui se "mange" du genreElement form not allowed as child of element tbody in this context. (Suppressing further errors from this subtree
Stray end tag form
J'en conclu que le formulaire doit etre en dehors de <table>, mais ci c'est bien le cas, comment puis-je avoir un formulaire avec un bouton submit par ligne???
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <table> <form> <tr> <td> </td> </form> </tr> </table>
Merciii!
Partager