Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7945339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:49:51+00:00 2026-06-04T00:49:51+00:00

After putzing around some, I have gotten this code to work to show me

  • 0

After putzing around some, I have gotten this code to work to show me an alert with the proper array of ids that are checked:

alert($("input[name=our_types]:checked").map(function () {return this.value;}).get().join(","));

I need to be able to pass it to the post action function here:

    $.post(action, {
        form_name: $('#form_name').val(),
        site_id: $('#site_id').val()


    },

I’ve tried doing:

   var our_types = $("input[name=our_types]:checked").map(function () {return this.value;}).get().join(",");

And then pass it like this:

    $.post(action, {
        form_name: $('#form_name').val(),
        site_id: $('#site_id').val(),
                    our_types: $('#our_types').val()

    },

But to no avail. I’ve been stuck on this for hours, maybe a fresh eye can help.

Heres a working code for another example:

jQuery(document).ready(function(){

    $('#contactform').submit(function(){

        var action = $(this).attr('action');

        $("#message").slideUp(750,function() {
        $('#message').hide();

        $('#submit')
            .after('<img src="assets/ajax-loader.gif" class="loader" />')
            .attr('disabled','disabled');

        $.post(action, {
            USERNAME: $('#USERNAME').val(),
            PASSWORD: $('#PASSWORD').val()
        },
            function(data){
                document.getElementById('message').innerHTML = data;
                $('#message').slideDown('slow');
                $('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
                $('#submit').removeAttr('disabled');
                if(data.match('success') != null) $('#contactform').slideUp('slow');

            }
        );

        });

        return false;

    });

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:49:52+00:00Added an answer on June 4, 2026 at 12:49 am

    You’re very close.

    When you

    alert($("input[name=our_types]:checked").map(function () {return this.value;}).get().join(","));
    

    and seeing the content is what you want.

    All you need to do is assign that to a variable:

    var our_types_vals = $("input[name=our_types]:checked").map(function () {return this.value;}).get().join(",");
    

    and pass that variable into the post() function like this:

    $.post(action, {
        form_name: $('#form_name').val(),
        site_id: $('#site_id').val(),
        our_types: our_types_vals
      },  // ... other codes
    );
    

    You can also bypass assigning it to a variable and pass the operation directly inside the property-value pairs object like this:

    $.post(action, {
        form_name: $('#form_name').val(),
        site_id: $('#site_id').val(),
        our_types: $("input[name=our_types]:checked").map(function () {return this.value;}).get().join(",")
      },  // ... other codes
    );
    

    Please pay attention to remove the ending semi-colon on the operation to prevent syntax error inside an object literal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After I thought that I've understood how they work, I tried this: NSString *str1
Good Sunday morning! After fiddling around with some JavaScript this weekend, I finally wrote
After loosing much sleep I still cannot figure this out: The code below (its
After searching around for months on and off I finally decided to post this
I've found this odd case of some code (below) doesn't compile under Visual Studio
I have a scrollable area that contains popup menus. Conceptually, something like this: <div
I have adapted this code from another gentleman on SO. It's working great so
I started a new project this morning and, after putting ~3 hours of work
I putting wmd on my website. After putting code in and giving it a
what does putting () after a word do? sometimes it doesn't work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.