[jQuery] Getting the id of the next form
<html>
<body>
Hello folks,
I have a page containing a number of forms e.g.
<tt><div id="alerts">
<x-tab> </x-tab>
<a href="#" class="ctrl_s">[an
image]</a>
<x-tab> </x-tab><form
id="f_alert">
<x-tab> </x-tab><x-tab>
</x-tab>[various form
elements]
<x-tab> </x-tab>
</form>
</div>
<div id="whodidit">
<x-tab> </x-tab>
<a href="#" class="ctrl_s">[an
image]</a>
<x-tab> </x-tab><form
id="f_whodidit">
<x-tab> </x-tab><x-tab>
</x-tab>[various form
elements]
<x-tab> </x-tab>
</form>
</div>
</tt>The class "ctrl_s" is bound to a function that will
serialize the contents of the form and send the contents (via ajax) to
the server for processing
<tt>$("a.ctrl_s").bind("click",function() {saveForm(
[the id of the next form] );});
</tt>How do I get the "id of the next form" for sending to the
"saveForm" function? I'm afraid that I just don't
yet understand selectors and traversing well enough to nut this out
myself.
Thanks,
Bruce</body>
</html>