var form_data = $('#add_post').serializeArray(); //encode in JSON string var post_title = form_data[0].value; var post_description = form_data[1].value;