动态添加的Html输入页面选项卡按钮不工作
Dynamically Added Html Inputs Page Tab Button Not Working
我正在添加动态HTML内容到我的弹出显示在下面
$.get(url, function (data) {
swal({
title: "",
text: data,
html: true,
showCancelButton: false,
showConfirmButton: false,
customClass: "dialog",
allowOutsideClick: true,
allowEscapeKey: true
},
function() {
console.log('');
});
这是我的动态html内容
@using (Html.BeginForm("GetSendMessagePopUp", "Help", FormMethod.Post, new {enctype = "multipart/form-data", id = "questionModelForm"}))
{
<div>
@Html.TextBoxFor(item => item.FullName, new { style = "display: block"})
</div>
<div>
@Html.TextBoxFor(item => item.Phone, new {style = "display: block"})
</div>
<div>
@Html.TextAreaFor(item => item.Message, new {style = "display: block"})
</div>
<a href="javascript:void(0)" onclick="sendUserMessage()" class="helpButton">Gönder</a>
}
</div>
一切正常,除了选项卡按钮不能聚焦另一个字段。
我在下面的开发人员面板中尝试过,但仍然不起作用
$('.dialog input').tabs();
$('.dialog input').tabs('refresh');
也添加这段代码:
$.ajaxComplete(function () {
$('.dialog input').tabs();
$('.dialog input').tabs('refresh');
// And whatever you wanna load fresh, after the AJAX call is completed.
});
From sweetalert.js我注释了tab键的默认值,然后它开始正常工作
// TAB
if (btnIndex === -1) {
// No button focused. Jump to the confirm button.
$targetElement = $okButton;
} else {
// Cycle to the next button
if (btnIndex === $modalButtons.length - 1) {
$targetElement = $modalButtons[0];
} else {
$targetElement = $modalButtons[btnIndex + 1];
}
}
_stopEventPropagation$fireClick.stopEventPropagation(e);
$targetElement.focus();
if (params.confirmButtonColor) {
_setFocusStyle.setFocusStyle($targetElement, params.confirmButtonColor);
}
我删除了这行,它可以正常工作
相关文章:
- 如何在不需要单击按钮的情况下获取选项的值
- 单击按钮即可在浏览器的新选项卡中打开 Sapui5 详细信息页面
- 复选框/单选按钮-添加所选项目的总价
- PayPal按钮是否有一个简单的选项,其中金额基于一些用户输入
- 更新:仅根据单选按钮和所选选项选择特定项目
- 如何在ASP.NET中单击按钮后激活启动选项卡
- 关于&从win8 RC转换为win8 RTM后,首选项弹出按钮为空
- 单击按钮进入下一个选项卡,而不是单击选项卡
- Angular:如何使用ngRepeat并设置默认单选按钮选项
- 如何更改单击按钮时的javascript滑块选项
- Ajax在使用onclick选项时无法处理HTML表单中的提交按钮
- 隐藏结账按钮,直到选择发货选项
- 如何将每个选项按钮与其自己的单个标记相关联
- IE9 问题:动态创建(通过 innerHTML)选项按钮和复选框不起作用
- 禁用javasscript中的选项/按钮
- “刷卡back"在离子项目后,点击离子选项按钮
- Bootstrap插件创建选项按钮与任意js
- 如何制作交互式选项按钮
- 使用javascript函数在url执行下拉选项/按钮
- 如何让浏览器“保存图像为”选项按钮