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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:21:31+00:00 2026-06-18T12:21:31+00:00

After following answers like this one , I’m trying to append data to a

  • 0

After following answers like this one, I’m trying to append data to a string using:

<input type='checkbox' name='a' />A
<input type='checkbox' name='b' checked='checked'/>B
<input type='checkbox' name='c' />C

var attr_str = $('input').serializeArray();
attr_str.push({q:'hello',p:'world'});

But it returns [object Object],[object Object]. What am I missing?

JSFIDDLE

  • 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-18T12:21:32+00:00Added an answer on June 18, 2026 at 12:21 pm

    I’m not sure what you’re trying to accomplish but only the input which is checked is going to be included by serializeArray(). You can read more about it here.

    But your array is being returned as an object as it should. To see the layout of the JSON of this object you could try JSON.stringify(attr_str).

    var attr_str = $('input').serializeArray();
    
    attr_str.push({q:'hello',p:'world'});
    
    $('body').append('<br><br>string='+JSON.stringify(attr_str));
    

    This will show that you are appending an object into yourattr_str array but only input ‘b’ is included because it is the only one that is checked. string=[{"name":"b","value":"on"}{"q":"hello","p":"world"}]
    To access this object you would simply use attr_str[0] then for a property of that object use attr_str[0].name. Which would print b.

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

Sidebar

Related Questions

After following this MVC 4 tutorial series I was trying some of the stuff
New to sql and php and trying to work through this one. After reading
After following the steps outline in this Fluent NHibernate tutorial I am stuck on
I'm trying to get my local dev django app to work after following these
I am trying to make a JQGrid for a simple table. After following through
I know that the web is full of questions like this one, but I
I am using this method to serialize my object: public static string XmlSerialize(object o)
I have data like this: Date 1st var 2nd var .... nth var benchmark
I'm trying to make a push animation from one side using a CATransition .
FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the

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.