$.post returns data but does not display it

$.post returns data but does not display it

Hi guys,

I need help with my $.post, it calls a php file which retrieves data from my database and should return a JSON datatype result.

I checked on firebug, and it does successfully retrieve the data in JSON format.  I however cannot get it to display on screen.  I want to populate input fields with the result accordingly. 

Here's a chunk of my javascript: (this function is being triggered by a dropdown)

  1. function updateBillingAddFields(address_book_id) {
            jQuery.post("ajax_checkout_confirmation.php", {
                        address_book_id: address_book_id,
                        action: 'get_shipping_add_details'
                    },
                    function(data){
                            var form_element = document.forms['address'];
                            form_element.elements['entry_name'].value = data.entry_name;
                            form_element.elements['entry_addr1'].value = data.entry_addr1;
                            form_element.elements['entry_addr2'].value = data.entry_addr2;
                            form_element.elements['entry_addr3'].value = data.entry_addr3;
                            form_element.elements['entry_addr4'].value = data.entry_addr4;
                            form_element.elements['entry_postcode'].value = data.entry_postcode;
                            form_element.elements['entry_state_name'].value = data.entry_state_name;
       
                        }
                , "json");
        }
















I tried putting alert('haha') inside my function, and it also doesn't show.  I'm thinking it doesn't go inside the function at all.  Any help is appreciated.

Thanks!