I have a Togglable tabs and would like to serialize the data only from the current index or the active
of the tab.
This form is "global" so to speak, and this tabs stays inside, an example of this would be:
<form>
<div class="servicos">
<label>foo</label>
<input type="text" name="foo">
<label>foo</label>
<input type="text" name="bar">
</div>
<div class="configuracoes">
<label>foo2</label>
<input type="text" name="foo2">
<label>foo2</label>
<input type="text" name="bar2">
</div>
<button id="enviar">Enviar</button>
</form>
Let's say I'm on the "settings" tab when saving I'd like to just get foo2,bar2
.
I've tried to do this:
$("form").submit(function(e) {
e.preventDefault();
$(this).find('.configuracoes').serialize();
});
The return of the serialize is empty, how could I partially serialize a form?