From 321e7dc309aa30587c6e74666e4d5be21c794ac5 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 19 Dec 2011 17:27:24 +0000 Subject: [PATCH] Keep the current value iin the search form when reloading the search form for a different (sub)class. For example Contact => Person. SVN:trunk[1725] --- js/utils.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/js/utils.js b/js/utils.js index c732ec65e..c85cd939b 100644 --- a/js/utils.js +++ b/js/utils.js @@ -119,8 +119,18 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext) } sAction = $('#ds_'+divId+' form').attr('action'); - $.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?'+sContext, - { operation: 'search_form', className: sClassName, baseClass: sBaseClass, currentId: divId, action: sAction }, + // Save the current values in the form + var oMap = {}; + $('#ds_'+divId+" form :input[name!='']").each(function() { + oMap[this.name] = this.value; + }); + oMap.operation = 'search_form'; + oMap.className = sClassName; + oMap.baseClass = sBaseClass; + oMap.currentId = divId; + oMap.action = sAction; + + $.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?'+sContext, oMap, function(data) { oDiv.empty(); oDiv.append(data);