0

次の行でFormタグのaction属性を設定しています

   $("#divIsInternational span").bind('click', function() {
    $('#action').val('bypcgDestination');
    var SelectedItem = $(this).attr("id");
    if (SelectedItem.toString() == "Domestic") {
        $(this).removeClass().addClass("domestic selected");
        $(this).siblings().removeClass("selected");

        $("#toDefaultPage").attr("action", "home/domestic");
    }
    else {
        $(this).removeClass().addClass("international selected");
        $(this).siblings().removeClass("selected");

        $("#toDefaultPage").attr("action", "home/international");
    }


    $("#isDomesticInMaster").val(SelectedItem);

    $("#toDefaultPage").submit();

});

Chromeでは正常に動作しますがfirefoxでは動作しません。Firefoxコンソールにもエラーメッセージが表示されないため、問題を見つけることができません。

4

2 に答える 2

0

ここで直面している問題を共有したいのですが、実際にはアクションとして非表示フィールドのIDが与えられています。これにより、フォームタグのアクションフィールドを設定できません。したがって、問題はid="action"の非表示フィールドです。

于 2012-12-03T06:51:16.180 に答える
0

セレクター#toDefaultPageがフォーム要素の場合、jQuery の組み込みの -function を使用できるはずです.submit(): http://api.jquery.com/submit/

于 2012-11-02T07:50:07.173 に答える