function _gadgetSaveForm(form,callback){
    var options = $('form[name='+form+'] input,form[name='+form+'] select,form[name='+form+'] hidden, form[name='+form+'] text').serializeArray();
    options.push({name:'formName',value:form});
    
    $.post('/Controller/Ajax.php', {
        action: 'ajax',
        request: 'saveForm',
        options: options
    }, function(data) {
        if (data.response){
            clearForm(form);
            callback(data);
        }else{
            $('#flashmessenger_'+form).html(data.msg);
            for (var name in data.errorElements) {
                $('form[name='+form+'] #'+data.errorElements[name]).closest("div.form-group").addClass("has-error has-feedback");
            } 
        }
    }, 'json');
}