0

I have multiple checkbox list that can be selected

name="campaign_ids"

I have a function setup in jquery that looks like this:

<script>
$('form#manage_campaigns').submit(function(){
    var formData = $(this);
    $.post(site_url + 'm/affiliates/ajax?action=save_affiliate_campaigns&aid=__aid__', formData, function(data) {
        $('#man_cam_container').fadeOut('fast', function(){
            $('#man_cam_container').html(data).fadeIn('slow');
            setTimeout(function () {
                $('#manage_campaigns').dolPopupHide({});
            }, 2000);

        });
    });
    return false;
})
</script>

What I'm trygin to figure out is how to post the array of "campaign_ids" to the URL. Any suggestions on what I'm doing wrong?

2 Answers 2

2
name="campaign_ids[]"

should do it

Sign up to request clarification or add additional context in comments.

Comments

0

Try doing this, using map:

var formData = {ids: $(this).find('[name="campaign_ids"]').map(function(){
    return this.value;
}).get() };

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.