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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:12:16+00:00 2026-06-16T17:12:16+00:00

I have this being POSTed to my script Array ( [0] => Array (

  • 0

I have this being POSTed to my script

Array
(
  [0] => Array
      (
          [name] => test1
          [value] => test1 value
      )

  [1] => Array
      (
          [name] => test2
          [value] => test2 value
      )
)

What I want is:

Array
(
  [0] => Array
      (
          [test1] => test1 value
      )

  [1] => Array
      (
          [test2] => test2 vlaue
      )
)

This is the JQuery I am using to post the data. Can someone tell me what I need to achieve this?

var vals = $("#post").find('input,select,textarea').serializeArray();
vals.push({
    name: 'article',
    value: CKEDITOR.instances.article.getData()
});
var qs = $.param(vals);

$.post('test.php', {
    data: vals
}, function (data) {
    if(data.success == 0) {

    }
}, 'json');

EDIT:
What I am looking to do is to simply access each key value on my server like this:

    echo $_POST['test1'];
...
  • 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-16T17:12:17+00:00Added an answer on June 16, 2026 at 5:12 pm

    When using $.post, the 2nd param is the data you want to send to the server. It’s not like $.ajax where you pass an object with options in it.

    Try this:

    var vals = $("#post").find('input,select,textarea').serializeArray();
    vals.push({
        name: 'article',
        value: CKEDITOR.instances.article.getData()
    });
    
    $.post('test.php', vals, function (data) {
        if(data.success == 0) {
        }
    }, 'json');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is a simple question. I have a form that is being validated using
Possible Duplicate: Can someone Explain this jQuery code? I have posted this before, but
I have a Jquery post script, which for reasons outside of my control has
I have a binary value being URL Encoded, and then POSTed to an HttpServlet.
I have a object with some data being posted to a php script from
I have this form which i submit using ajax and jquery , well, i
I have this running software that is currently being used by about 400 people.
I have this fixed-width file with the widths being 34, 2, 3, 2, 1,
I have this code for a select box which is being displayed by the
I have this code so far which perfectly but relies on there being a

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.