Lahlan works "almost" perfectly. The problem is when the form is saved, then restored, and then saved again, and the radio and checkboxes are not removed, but instead just save the recipe. A simple fix below.
$("input, select, textarea").each(function () { var $this = $(this); if ($this.is("[type='radio']") || $this.is("[type='checkbox']")) { if ($this.prop("checked")) { $this.attr("checked", "checked"); } else { $this.removeAttr("checked"); } } else { if ($this.is("select")) { $this.find(":selected").attr("selected", "selected"); } else { $this.attr("value", $this.val()); } } });
source share