[英]How to pass the array of input data to Ajax function?
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? 我需要在Ajax中发布此数据,我该怎么做?
Serialize your form and pass that value in ajax. 序列化您的表单,并在ajax中传递该值。
var form_Data = $('#your_form_id').serialize();
jQuery.ajax({
type: 'POST',
url: '<?php echo your_url; ?>',
data:form_Data,
success:function(data) {}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.