drbuowqe02101 2009-10-31 19:45
浏览 61
已采纳

表头中的输入框不起作用

I have a problem with a table header containing input boxes. I have similar div's in the rest of the table and they work fine. the div is hidden by default, and is absolutely positioned The table inside the div usually just contains a few columns with a single form element in each column. This would be typical:

<a>show editrow</a>
<div class="editrow">
    <form>
        <table>
            <tr>
                <td>
                    <input type="text" />
                </td>
                ...
                <td>
                    <input type="submit" />
                </td>
            </tr>
        </table>
    </form>
</div>

I have this in a th element in the header, and in each table row below. When I put it in a th element I can't click on the input boxes, but the select boxes, and checkboxes work fine. I am using JQuery table sorter so my table headers have to use thead, tr, th tags. The frustrating thing is the only difference between what works and what doesn't work is the containing cell, td vs, th. like so:

<th>
    doesn't work
</th>

vs.

<td>
    does work
</td>

The only fix I have found is to move the div outside of the header, and use some more complicated javascript to find it so I can show/hide it/etc. I don't like that solution, because I'd have to rewrite a lot of pages, and it just doesn't make sense. I put the link and div in the header to keep it from being sorted with the rest of the table.

Any ideas as to why? or how I can fix it without removing the div from all my table headers?

  • 写回答

1条回答 默认 最新

  • douping1825 2009-11-02 12:07
    关注

    I've created a quick test page with an input field in the header and it worked fine in all the browsers I tested it in.

    Have you tried removing all the jQuery code from the page and then testing it? I could be something in the jQuery table sorter code that disables input fields for some reason.

    Have you used something like firebug to inspect the input element to see if it's disabled or hidden behind some other element making it unclickable?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配