0

我有以下代码用于发布信息以更新事件。当我注释掉“id”参数时,帖子成功并且我从服务器收到信息。但是,如果没有注释掉“id”,则不会发送任何内容。

var user = localStorage["user"];
var pw = localStorage["pw"];
var org = localStorage["org"];
var eventid = localStorage["eventid"];
$(function () {
        $("#submit").click(function () {
            if ($("#cancelled:checked")){
                cancel = "on";
            }else {
                cancel = "";
            }
            $.post(
                "/App/SetNewEvent/default.asp",
                {
                    user: user,
                    key: pw,
                    org: org,
                    id: eventid,
                    playdate: $("#playdate").val(),
                    start: $("#start").val(),
                    finish: $("#finish").val(),
                    location: $("#facilityid").val(),
                    tournament: $("#type").val(),
                    cancelled: cancel,
                    team: $("#teamid").val(),
                    homeopponent: $("#homeopponentid").val(),
                    schednote: $("#note").val()
                },
                function (response) {
                    console.log(response);
                }
            );
        });
    })
4

0 回答 0