I need to edit a web app written in PHP and HTML. There is an opening <form>
and closing </form>
tag. In between is an HTML table to layout the form fields. There is a table within this table and form fields also inside this inner table, but these aren't showing in PHP when the page is submitted. Fields (and their values) in the outer table are. How can I begin to trouble shoot this?
<form>
<table>
<tr>rows of fields</tr>
<tr>
<table>
<tr>an inner table of stuff</tr>
</table>
</tr>
</table>
</form>
P.S. I know, tables instead of CSS, that's a story for another day!
table within a table is not valid. Instead do it like this
<form>
<table>
<tr>
<td>rows of fields</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>an inner table of stuff</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
The answer is to make sure the HTML is valid: http://validator.w3.org/
Once it validates, it will just work.
That is invalid HTML. <table>
tags and <tr>
tags can't contain other <table>
tags, you need to at least use a <td>
.
try this:
<form>
<table>
<tr><td>rows of fields</td></tr>
<tr><td>
<table>
<tr><td>an inner table of stuff</td></tr>
</table>
</td></tr>
</table>
</form>