【问题标题】:Jquery dialog, javascriptJquery 对话框,javascript
【发布时间】:2010-09-28 14:10:31
【问题描述】:

我有一个带有输入文本和一些复选框的 jquery 对话框。

问题是我无法设置焦点或在输入中输入文本,

我正在使用 jqueryui 1.7.3 和 1.3.2 核心,firefox 3.6.10?

在 IE 上不存在这个问题,那么这是 jquery 或 firefox 的错误吗?

有什么解决办法吗? 谢谢

代码:

    $('#corr_types').dialog({
    width:160,
    title: 'Set correction type',
    open:function()
    {
        //input temporani della form
        $(this).find("input:radio").attr('checked','');
        $(this).find("input:radio[value="+type+"]").attr('checked','checked');

        $(this).find("input:checkbox").attr('checked',mpc);
        $(this).find("input:text").val(catno).focus();
    },
    close: function() { 
        $(this).dialog( "destroy" );
    }
});


    <div id="corr_types"  class="corrtypes" style="display:none;" >
<input type=checkbox  >MPC<br /> Catno. <input type="text" size=10 
</div>

【问题讨论】:

  • 这是哪个对话框?您有一些代码要与我们分享吗?
  • 这很可能是您的代码有问题。所有这些都将被证明可以与您正在使用的库一起使用。因此,我们需要先查看您的代码,然后才能为您提供帮助。
  • 是的,我发布了代码,请注意我在打开的窗口中打开了多个对话框
  • 您发布的代码在这里运行良好:jsfiddle.net/EP4af/1 但也许不是在所有浏览器中?
  • 我明白了,但我仍然有问题,可能是因为我有很多对话框?

标签: jquery jquery-ui dialog


【解决方案1】:

首先,

<input type=checkbox  >MPC<br /> Catno. <input type="text" size=10 

应该是

<input type="checkbox" name="mpc" />MPC<br /> Catno. <input type="text" size="10"/> 

【讨论】:

  • 是的,我知道我在这里写和复制只是为了说明代码
猜你喜欢
  • 2023-03-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-26
  • 1970-01-01
相关资源
最近更新 更多