0

以下のようにラジオボタンを手動でチェックする必要があります。しかし問題は、イベントが発生しないことです (手動でチェックした場合)。

$(function () {
    // always check the 1st element
    $("input:radio[name=MatrixID]:first").attr('checked', true).click();
});

$('.editor-field > input[type=radio]').change(function () {
    // !!! not fired when checked by code!!??
    p.mustSave = true;
});

私の質問:ラジオボタンを手動で(コードで)チェックし、変更イベントをトリガーする方法は?

私のhtml:

            <p>
                <span class="editor-field">
                    <input name="MatrixID" id="MatrixID873" type="radio" checked="checked" value="873"/>
                </span>
            </p>  

どうもありがとう。

4

1 に答える 1