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 8156425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:56:57+00:00 2026-06-06T16:56:57+00:00

I want to pass arrays in the jquery $.post() request. HTML: <input type=checkbox id=add-check-1e30>

  • 0

I want to pass arrays in the jquery $.post() request.

HTML:

<input type="checkbox" id="add-check-1e30">
<input type="checkbox" id="add-check-1230">

From the above example HTML the array should be like this = [‘1e30’, ‘1230’]

jQuery for sending $.post():

$("#addbox-add").click(function(){

var ukeys = new Array();
$("input[type=checkbox]:checked").each( function() {
a = $(this).attr("id");
b = a.split('-').pop();
ukeys.push(b);
});

$(".addbox").remove();

$.post("/information/portfolio/add/", {'ukeys': ukeys }, function(data) {
for(i=0; i<data.length; i++)
{
    ukey = data[i].ukey;
    image = data[i].image;
    service = data[i].service;
    if(data[i].smallimage != "")
    {
        image = data[i].smallimage;
    }
    if (image == null)
    {
        $(".portfolio-preview").append('<li class="portfolio-item" id="portfolio-item-'+service+'-'+ukey+'"></li>');
    }
    else
    {
        $(".portfolio-preview").append('<li class="portfolio-item" id="portfolio-item-'+service+'-'+ukey+'"><img class="portfolio-image" src="'+image+'" width="150px" height="150px"></li>');
    }
}
});

});

There is no problem with the array variable in jQuery, I don’t know how to send it in the post request.

I’m supposed to get those two values 1e30 and 1230 in the server. But the values I’m getting in the server is null.

Here is the server code for fetching the values in Python/Django:

def portfolio_add(request):
    ukeys = request.POST.get('ukeys', '')   
    .....etc.....etc......

Thanks!

  • 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-06T16:56:59+00:00Added an answer on June 6, 2026 at 4:56 pm

    You have to use:

    request.POST.getlist('ukeys', '')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to pass an IEnumerable collection from view to controller using JQuery from
I want to pass an array of objects from my QtScript to C++ but
I'd like to pass content back and forth from PHP to jQuery and vice
I have an a JQuery array , which I want to pass on to
I need to pass an array of numeric values from jQuery to a php
I want to use the jquery autocomplete plugin across several input boxes. In order
I have a PHP array that I want to pass to the jQuery function
I using jquery's $.post to pull information from a database dynamically. This works fine
I want to pass an array of arbitrary struct pointers and a comparison function
In my Delphi development, I want to pass an array of const(that can contains

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.