0

In my input field name is like:

name="diameters[0][top]"
name="diameters[0][bottom]"
name="diameters[1][top]"
name="diameters[1][bottom]"

It's a two dimensional array.

I need to post this data in Ajax, how can I do that?

5
  • What you’ve described is not clear at all. This is a PHP array; it’s not clear how you expect this to look like in JavaScript. What have you tried? Commented Jul 12, 2017 at 5:30
  • this is my console output Commented Jul 12, 2017 at 5:31
  • Please edit your question and make it clear. Commented Jul 12, 2017 at 5:32
  • Edit the question.Plz check Commented Jul 12, 2017 at 5:57
  • Questions that ask "please help me" tend to be looking for highly localised guidance, or in some cases, ongoing or private assistance, which is not suited to our Q&A format. It often reads like a form of begging, which may attract downvotes. It is also rather vague, and is better replaced with a more specific question. Please read Why is “Can someone help me?” not an actual question?. Commented Sep 7, 2017 at 9:10

1 Answer 1

2

Serialize your form and pass that value in ajax.

  var form_Data     = $('#your_form_id').serialize(); 
   jQuery.ajax({
                 type: 'POST',
                 url: '<?php echo your_url; ?>',
                 data:form_Data,                           
                 success:function(data) {}

                 });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.