Skip to content

Commit

Permalink
Fixing the serialization issue. The input (submit) buttons don't get …
Browse files Browse the repository at this point in the history
…serialized somehow. So they have to be manually serialized and sent
  • Loading branch information
Thejaswi Puthraya committed Dec 15, 2009
1 parent 9768d96 commit 84e4949
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions frontendadmin/templates/frontendadmin/form_ajax.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

<script>
var form = $("form#form-{{ action }}-{{ model_title|slugify }}");
form.submit(function(){
$.post("{{ action_url }}", form.serialize(), function(html) {
$("#container-{{ action }}-{{ model_title|slugify }}").html(html);
});
return false;
});
form.submit(function(){
return false;
});

$("input[type=submit]").each(function(i, k){
$(k).click(
function() {
$.post("{{ action_url }}", form.serialize()+"&submit="+$(this).attr("name"), function(html) {
$("#container-{{ action }}-{{ model_title|slugify }}").html(html);
});
});
});
</script>

<div id="container-{{ action }}-{{ model_title|slugify }}">
Expand All @@ -32,4 +38,4 @@
</p>
</form>
</fieldset>
</div>
</div>

0 comments on commit 84e4949

Please sign in to comment.