によって返される各要素に対して
{! followers }
1 つのチェックボックスが作成されます。送信ボタンがあり、「送信時に」チェックボックスがチェックされているチェックボックスとチェックされていないチェックボックスを記録したい。
<apex:repeat value="{! followers }" var="follower">
$('#attendees').append(
$('<div>').css('display','inline').append(
$('<input>', {type:"checkbox"}).addClass('myCheckBox').attr('id', '{! follower.subscriberId }')
).append(
$('<label>').text('{! follower.Subscriber.Name }')
)
);
</apex:repeat>
これらのチェック ボックスの値を送信ボタンに渡すにはどうすればよいでしょうか。送信ボタンに到達したら、alert() または console.log() したいだけです。
もしかしてこういうこと?
if ($('.myCheckBox').is(':checked')){
alert($('.myCheckBox').attr(???))
};
それともこれ?
if ($('#attendees input').is(':checked')){
alert($('#attendees input').attr('???'))
};