验证者问题

时间:2015-04-21 11:09:53

标签: html validation html-table

我的代码,HTML 4.01 Transitional:

<table cellspacing="0" cellpadding="0" border="0" class="forms" id="form-control-number">
        <tr>
            <td colspan="6" align="right">
                <span class="nadpis">Pole pro 14 pozic (*)</span>
            </td>
        </tr>
            <form action="">
                <tr>
                    <td><label class="required" for="numero">GTIN-8</label></td>
                    <td><INPUT id="numero" class="middle" TYPE="text" NAME=numero SIZE=17 MAXLENGTH=7></td>
                    <td><INPUT class="text-small" TYPE="text" NAME=cc SIZE=1 READONLY></td>
                    <td><INPUT class="submit" TYPE="submit" VALUE="Vypočti" ONCLICK="ccc8(this.form); return false;"></td>
                    <td class="reset-col"><INPUT class="submit" TYPE="reset" VALUE="Vymaž"></td>
                    <td><INPUT class="text" TYPE="text" NAME=chiffre SIZE=14 MAXLENGTH=14 READONLY><span class="hidden-desktop hidden-tablet">Pole pro 14 pozic (*)</span></td>
                </tr>
            </form>
            <form action="">
            <tr>
                <td><label class="required" for="numero2">GTIN-12</label></td>
                <td><INPUT id="numero2" class="middle" TYPE="text" NAME=numero SIZE=17 MAXLENGTH=11></td>
                <td><INPUT class="text-small" TYPE="text" NAME=cc SIZE=1 READONLY></td>
                <td><INPUT class="submit" TYPE="submit" VALUE="Vypočti" ONCLICK="ccc12(this.form); return false;"></td>
                <td class="reset-col"><INPUT class="submit" TYPE="reset" VALUE="Vymaž"></td>
                <td><INPUT class="text" TYPE="text" NAME=chiffre SIZE=14 MAXLENGTH=14 READONLY><span class="hidden-desktop hidden-tablet">Pole pro 14 pozic (*)</span></td>
            </tr>
            </form>
</table>

验证者正在写:document type does not allow element "FORM" here (line 7) document type does not allow element "TR" here (line 8)

有谁知道为什么会发生这种错误?

1 个答案:

答案 0 :(得分:0)

您无法将表单元素添加为<table><tr>元素的直接子元素。尝试使用<table>围绕<form>