输入错误:' stepUp'调用了一个没有实现接口HTMLInputElement的对象

时间:2015-04-20 05:36:10

标签: jquery

我有一个“ApplyChanges”按钮,单击此按钮我想更新值并尝试通过控制器保存到数据库,但我收到错误:Type Error: 'stepUp' called on an object that does not implement interface HTMLInputElement.

这是我的代码:

function ApplyChanges_Click()
{
    alert('Test');
    var moduleTitle = $("#moduleName").val();
    var cacheTimeout = $("#cacheTimeout").val();
    alert(cacheTimeout);
    var authorizedRoles = "";
    $('input[name="Roles"]:checked').each(function() {
        authorizedRoles = authorizedRoles + $(this).val() + ";";
    });
    alert(authorizedRoles);
    if ($('#showmobile').is(':checked')) {
        var showMobile = true;
    }
    alert(showMobile);
    jQuery.ajax({
        type: "POST",
        url: "/Admin/UpdateModuleSettings",
        dataType: "html",
        data: { 'moduleId': '@ViewBag.moduleId', 'moduleTitle':  moduleTitle, 'cacheTimeout': cacheTimeout, 'authorizedRoles': authorizedRoles, 'showmobile': showmobile, 'tabId': '@ViewBag.tabId' },
        success: function(response) {
            $("#LeftPane").html("");
            $("#RightPane").html("");
            $("#ContentPane").html(response);
        },
        error: function(xhr, ajaxOptions, thrownError) { }
    });
}

1 个答案:

答案 0 :(得分:0)

“数据”选项的某些变量可能为空:

  • moduleTitle
  • cacheTimeout
  • authorizedRoles
  • showmobile