[thelist] <FORM> Tag Placement in Tables

John Corry webshot at neoncowboy.com
Mon Jun 19 16:29:22 2000


>If I have the following code it does not work in IE or NN:
> <table border="0" cellpadding="7" cellspacing="1" width="630">
>    <tr>
>       <form name="f1" method="post" action="../Cgi-bin/redirect.pl"
>             onSubmit="return false;">
>          <td>Category<br><br>
>            <input type="Submit" value="Go" onClick="jmp(this.form,0);"
>                    id="Submit1" name="Submit1">
>         </td>
>          <td>
>             <select name="m1" id="m1" class="saveHistory" size="3"
>                      onChange="relate(this.form,0,this.selectedIndex)">
>                <option value="../Develop.htm">Methodology
>                 <option value="../Develop.htm">Subject Matter Analysis
>                 <option value="../Develop.htm">Data Quality
>
>              </select>
>          </td>
>       </form>
>    </tr>
> </table>
>
>But if I have the following code it works!  Why???

Look carefully at the code...
'Where' (conceptually, in regards to the HTML structure, not physical
location via line numbers) is the <form> tag? It's in between the <tr> and
<td>, technically, it's 'nowhere' in the structural flow of the document.
The browser isn't rendering it because it can't, for the same reason an
image, paragraph, header or anythin gelse wouldn't work there.

I think there's a rule about forms and tables, but I find that I get best
results when placing the <form> tag outside of the <table> tag..like this.

>       <form name="f1" method="post" action="../Cgi-bin/redirect.pl"
>             onSubmit="return false;">
> <table border="0" cellpadding="7" cellspacing="1" width="630">
>    <tr>
>          <td>Category<br><br>
>            <input type="Submit" value="Go" onClick="jmp(this.form,0);"
>                    id="Submit1" name="Submit1">
>         </td>
>          <td>
>             <select name="m1" id="m1" class="saveHistory" size="3"
>                      onChange="relate(this.form,0,this.selectedIndex)">
>                <option value="../Develop.htm">Methodology
>                 <option value="../Develop.htm">Subject Matter Analysis
>                 <option value="../Develop.htm">Data Quality
>
>              </select>
>          </td>
>    </tr>
> </table>
>       </form>


hth,
John Corry
student of design
R35 Edu
http://www.r35.com/edu
'Higher learning for a better web'