开发者

serialize fieldset content of a form

this is my code: http://jsfiddle.net/michelejs/Pt6LQ/25/

I would to serialize only the fieldset name= cap1.

So I tried to modify

$('#result').text(JSON.stringify($('form').serializeObject()));

in

        $('#result').text(JSON.stringify($('fieldset#cap1').serializeObject()));

but it doesn't work and return me {}. How can I modify the code for serialize only one fieldset content and not all t开发者_如何学JAVAhe form?

Thanks a lot.


You should use:

 $('fieldset#cap1 input').serializeObject()));

updated fiddle:

http://jsfiddle.net/Pt6LQ/26/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜