Commit 5075b31b525a47f396d72351d9b1b9595b5e6463

Authored by Neil Blakey-Milner
1 parent bb93aa59

Don't put quotes around text keys to input arrays - they aren't needed,

and they just add the quotes into the request variable.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3817 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/js/constructed_search.js
@@ -63,7 +63,7 @@ function addNewCriteria(add_button) { @@ -63,7 +63,7 @@ function addNewCriteria(add_button) {
63 // ok, warn the user that we're loading the item. 63 // ok, warn the user that we're loading the item.
64 replaceChildNodes(notify_message, 'loading...'); 64 replaceChildNodes(notify_message, 'loading...');
65 var newCriteriaText = scrapeText(select.options[select.selectedIndex])+' '; // FIXME insert the "input" here. 65 var newCriteriaText = scrapeText(select.options[select.selectedIndex])+' '; // FIXME insert the "input" here.
66 - replaceChildNodes(select.parentNode, newCriteriaText, INPUT({'type':'hidden', 'name':'boolean_search['+critId+'][\'type\']','value':select.value})); // works thanks to DOM co-ercion. 66 + replaceChildNodes(select.parentNode, newCriteriaText, INPUT({'type':'hidden', 'name':'boolean_search['+critId+'][type]','value':select.value})); // works thanks to DOM co-ercion.
67 createAdditionalCriteriaOption(); 67 createAdditionalCriteriaOption();
68 var removeButton = INPUT({'type':'button', 'value':'Remove'}); 68 var removeButton = INPUT({'type':'button', 'value':'Remove'});
69 attachToElementEvent(removeButton, 'click', partial(removeCriteria, removeButton)); 69 attachToElementEvent(removeButton, 'click', partial(removeCriteria, removeButton));
@@ -96,11 +96,11 @@ function do_addNewCriteria(destination_cell, crit_id, req) { @@ -96,11 +96,11 @@ function do_addNewCriteria(destination_cell, crit_id, req) {
96 96
97 for (var i=0; i<inputs.length; i++) { 97 for (var i=0; i<inputs.length; i++) {
98 var obj = inputs[i]; 98 var obj = inputs[i];
99 - obj.name = "boolean_search["+crit_id+"]['data']['"+obj.name+"']"; 99 + obj.name = "boolean_search["+crit_id+"][data]["+obj.name+"]";
100 } 100 }
101 for (var i=0; i<selects.length; i++) { 101 for (var i=0; i<selects.length; i++) {
102 var obj = selects[i]; 102 var obj = selects[i];
103 - obj.name = "boolean_search["+crit_id+"]['data']['"+obj.name+"']"; 103 + obj.name = "boolean_search["+crit_id+"][data]["+obj.name+"]";
104 } 104 }
105 simpleLog('DEBUG','criteria addition complete.'); 105 simpleLog('DEBUG','criteria addition complete.');
106 } 106 }