I’m familiar with Malsup ajaxForm plugin. I think it could be improved, but I’m not sure how to tweak it, so I’d like to just write my own.
I have a forms in this exact format:
<form id="form1" action="./file.php" method="post" class="ajaxform">
<input type="hidden" name="action" value="updateValues" />
<fieldset><legend>Form Descriptor</legend>
<input ... />
<input ... />
<input ... />
<input type="submit" />
</fieldset>
</form>
I’d like to write a simple form ajaxer that submits the data, and can be initiated similar to malsup’s
$('.ajaxform').ajaxify(); // or
$('.ajaxform').each(function(id, o) { ... });
but whatever contents are returned – the contents inside the <fieldset> are updated.
similar to
$('#form1 fieldset').load('file.php #form1 fieldset')
Please advise!
It’s undocumented that the function callback passed to malsup’s
ajaxForm()actually receives parameters.