我似乎已經成功地算出這個對我自己。對於那些曾經遇到過問題的人,我希望這可以幫助你。
這裏是我的jsfiddle工作版本。 http://jsfiddle.net/Bf28Q/1/
<div id="cust-data-accordian">
<h3>Joe Schmoe: 1</h3>
<div id="ac_panel_1">
<form name="frmDlyUpld" id="frmDlyUpld_1" mehtod="post" action="/functions/update">
<input type="hidden" name="account_id" id="account_id_1" value="1" />
First name: <input type="text" name="firstname" id="firstname_1" value="Joe" /><br />
Last name: <input type="text" name="lastname" id="lastname_1" value="Schmoe" /><br />
<input type="submit" name="frmSubmit" id="fromSubmit_1" />
</form>
</div>
<h3>Jane Schmoe: 2</h3>
<div id="ac_panel_2">
<form name="frmDlyUpld" id="frmDlyUpld_2" mehtod="post" action="/functions/update">
<input type="hidden" name="account_id" id="account_id_2" value="2" />
First name: <input type="text" name="firstname" id="firstname_2" value="Jane" /><br />
Last name: <input type="text" name="lastname" id="lastname_2" value="Schmoe" /><br />
<input type="submit" name="frmSubmit" id="fromSubmit_2" />
</form>
</div>
</div>
var values = {};
$('#cust-data-accordian').accordion({
activate: function(i, e) {
var panel_id = e.newPanel[0].id;
var acct_id = panel_id.match(/\d+/);
var inputs = $('#frmDlyUpld_' + acct_id + ' :input');
inputs.each(function() {
values[this.name] = $(this).val();
});
console.log(values);
}
});
發表您的jsfiddle –
我想,但我似乎無法得到手風琴到的jsfiddle正常工作。抱歉。 – Skittles
我就給你看來什麼,我試圖做一個的jsfiddle。 http://jsfiddle.net/Bf28Q/ – Skittles