我有以下html:
<form class="add_skill_form">
<input type="hidden" name="skills[][skill_title]" value="Skill 1" />
<input type="hidden" name="skills[][skill_level]" value="1" />
<input type="hidden" name="skills[][skill_title]" value="Skill 2" />
<input type="hidden" name="skills[][skill_level]" value="2" />
</form>
如果可能的话,我想用 JQuery 序列化它,如下所示:
var loFormFields = $('.add_skill_form').serializeArray();
现在我没有得到我想要的参数,如下所示:
$_POST['skills'] = array
(
0 => array('skill_title' => 'Skill 1', 'skill_level' => 1),
1 => array('skill_title' => 'Skill 2', 'skill_level' => 2)
)
任何人有任何线索?
谢谢!