我有一个包含输入元素数组的表单,如下所示。
<form method="post" action="sample.php">
<input type="text" name="field[txt][name]" />
<input type="text" name="field[txt][sex]" />
<input type="text" name="field[txt][location]" />
<br /><br />
<input type="text" name="field[num][age]" />
<input type="text" name="field[date][pod]" />
<input type="text" name="field[date][doj]" />
<br /><br />
<input type="submit" name="submit" />
</form>
php - 当我像往常一样提交表单时,print_r($_POST['field']) 给我一个类似于以下的输出。如何使用 jquery-post 方法提交 'field[ ][ ]' 元素以获得相同的结果?
Array(
[txt] => Array
(
[name] => sam
[sex] => male
[location] => somewhere
)
[num] => Array
(
[age] => 20
)
[date] => Array
(
[pob] => 2001-01-01
[doj] => 2001-01-01
)
)
任何帮助将不胜感激。