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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:20:23+00:00 2026-06-11T16:20:23+00:00

I am storing some key and values in javascript dictionary var list_of_addressbook_entries = {};

  • 0

I am storing some key and values in javascript dictionary

var list_of_addressbook_entries = {};

and i am passing that dictionary on a php page

But when i am trying to get the key and value of javascript dict like

 $attendee_list = $_POST['dict_of_externals'];
   $shared_attendee_list = $_POST['list_of_shared_addressbook_entries'];
   $org_attendee_list = $_POST['dict_of_org_users'];

   echo json_encode($attendee_list);


   return false;

As a response i am getting only "[object Object]"

i just want to know the way how can i extract the values in php ?

in my javascript

for(key in list_of_addressbook_entries)
        {
          alert("key " + key
             + " has value "
          + list_of_addressbook_entries[key]);
        }

is printing the key and values

Updated

var list_of_addressbook_entries_privilege = [];
function showDetails(guest_name){
        var user_name = "<?php echo $_SESSION["user_name"]; ?>" ;
        var name = prompt("Please use M for moderator and A for attendee", "Type you name here");
        if (!name == null && !name== '' || name == 'M' || name == 'A'){

        var ahtml='<div  id ="div_id_'+guest_name+'" onclick =remove_addressbook_user("'+guest_name+'") class="addr_list" style="display:block; background: none repeat scroll 0% 0% peachpuff;margin-bottom:1px;">'
        ahtml = ahtml + '<span>'+guest_name+'</span>'
        ahtml = ahtml + '<input type = "hidden" id ="user_id_'+guest_name+'"   value = "'+guest_name+'"  /></div>'
        $(".address_book_list").append(ahtml);
        $("#div_id_"+guest_name).hide();
        list_of_addressbook_entries[guest_name] = name ;
        }
        else{
            alert("You have entered the worong value ");
            return false;
        }
        $('#dict_of_externals').val(list_of_addressbook_entries);

        for(key in list_of_addressbook_entries)
        {
          alert("key " + key
             + " has value "
          + list_of_addressbook_entries[key]);
        }


}
  • 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-11T16:20:24+00:00Added an answer on June 11, 2026 at 4:20 pm

    As you can iterate the pair of key values with for in, list_of_addressbook_entries is an object.

    You can’t put an object inside a value property. The value property supports strings only.

    Hence JS converts your object to a string, for which the string representation is [object Object].

    If you want a string representation of the JSON object you will use JSON.stringify:

    $('#dict_of_externals').val(JSON.stringify(list_of_addressbook_entries));
    

    if you want to access the JSON object’s properties later, you’ll have to parse the string again with JSON.parse (or jQuery.parseJSON), hence I’d recommend keeping the object in the memory in case you need to access its property values later.

    Here’s a small JS library if you need to JSON.stringify support for IE<=7:
    https://github.com/douglascrockford/JSON-js

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

Sidebar

Related Questions

I'm trying to initialise some data values dynamically inside a javascript object, but when
I'm considering storing some date values as ints. i.e 201003150900 Excepting the fact that
I'm trying to fetch some simple text over HTTP from JavaScript: $(function() { $.get(http://mydomain.com/path,
I am storing some values that I am getting from server in the database
I'm thinking about trying MongoDB to use for storing our stats but have some
I am writing some key/values on my phonegap app with javascript on the html5
I'd like to bypass some frequent queries by storing str(key) in memcache. When I
I have an issue while storing some special character values into db. For e.g.
I am trying to parse url-encoded strings that are made up of key=value pairs
I saw some code which was storing key,value pairs in 2 arrays. The only

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.