I am currently working on jqGrid add / edit form. I am implementing custom buttons on both add and edit. with one of the custom buttons I have implemented javascript to post the form to server and reload the grid. This is currently working fine however, the form does not clear of the data that was entered.
i.e I'll like to know how to clear off fields the add form after submitting?
see code below:
beforeShowForm: function () {
$('<a href="#">Save and New<span class="ui-icon ui-icon-disk"></span></a>')
.click(function () {
$.post('<c:url value="/programmes/create"/>',
$('#FrmGrid_list2').serialize(),
function (data) {
$('#list2').trigger("reloadGrid");
});
}).addClass("fm-button ui-state-default ui-corner-all fm-button-icon-left")
.prependTo("#Act_Buttons>td.EditButton");
}