Question -- it seems that I cannot have two forms embedded into a single table AND have my HTML validate. For example, W3 Validator gives me Element <form> not allowed as child of element <tr> in this context.
I don't see a way to go around validation errors.
What I want to achieve is this:
Example UI
Numbers are input fields and save/delete are buttons.
My simplified non-conforming HTML below:
<!DOCTYPE html>
<html>
<head>
<title>HTML</title>
</head>
<body>
<table>
<tr>
<form>
<td><input type="text" name="row_id" value="1"></td>
<td><input type="text" name="five" value="5"></td>
<td><input type="text" name="three" value="3"></td>
<td><input type="submit" value="Save This Row"></td>
</form>
<td><form>
<input type="text" name="row_id" value="1">
<input type="submit" value="Delete This Row">
</form></td>
</tr>
</table>
</body>
</html>
HTML works surprisingly, but it does not validate. I am seeking a solution where it does both - work and validate.
You have several options:
input
buttons with the form
attribute. This way each form would be inside one cell and it would be connected with input
elements outside it with those attributes. This would be the cleanest solution, but the form
attribute is not supported by IE.