HTML标记在某些浏览器中不起作用

时间:2013-11-15 15:39:18

标签: html firefox cross-browser form-submit

我有一个HTML表单,查找员工的提交按钮在Firefox中不起作用,但在IE和Chrome中也起作用。任何建议或想法为什么会这样?

 <form action="employees.cfm" name="limit_options" id="a"  method="post" >

   <cfoutput>

    <input  type="hidden"
     name="LV_ALPHA" 
     id="LV_ALPHA"
     value="" 
    />

    <th>

     <input  type = "text" 
     name = "LV_VNDR_NAME"  
     value = "#htmlEditFormat(LV_VNDR_NAME)#"
     size = "15"
     maxlength = "15"
     height    = "200px" />
    >
   </th>
  <th>

    <input  type = "text" 
     name = "LV_VNDR_NAME"  
     value = "#htmlEditFormat(LV_VNDR_NAME)#"
     size = "10"
     maxlength = "6"
    />
  </th>
  <th colspan="3">

    <input  type = "text" 
     name = "LV_ASSIGNED_USERID"  
     value = "#htmlEditFormat(LV_ASSIGNED_USERID)#"
     size = "10"
     maxlength = "7"
    />
  </th>

   <th colspan="7">
    <!-- Problem with this button in firefox -->
    <input  type = "submit"
     name = "LV_Submit5"  
     value = "Find Employees"
    />

     &nbsp; &nbsp; &nbsp; 

     <input  type="reset" value="Clear">

  </th>
</cfoutput>             

                </form>

1 个答案:

答案 0 :(得分:2)

您的HTML无效。您不能将<th>作为<form>的子元素。

有些浏览器(当然是Firefox)通过移动表单来错误地从表格交错表格的错误中恢复,因此它出现在表格之后(同时将输入留在后面)。

这解释了您的问题(如果按钮不在表单中,则不会提交)。

使用a validator。写有效标记。