From f82889b9a1866c045141af3238da91787156abbc Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 25 Sep 2019 14:00:08 +0800 Subject: [PATCH] Fix #6045 - use formdata to handle forms - testing with press release --- Roo/form/BasicForm.js | 11 +++++++++++ roojs-all.js | 10 +++++----- roojs-debug.js | 11 +++++++++++ roojs-ui-debug.js | 11 +++++++++++ roojs-ui.js | 10 +++++----- 5 files changed, 43 insertions(+), 10 deletions(-) diff --git a/Roo/form/BasicForm.js b/Roo/form/BasicForm.js index 5beb65a446..3e2d779534 100644 --- a/Roo/form/BasicForm.js +++ b/Roo/form/BasicForm.js @@ -538,6 +538,17 @@ clientValidation Boolean Applies to submit only. Pass true to call fo }, this); } + // use formdata + if (typeof(FormData) != 'undefined' && asString !== true) { + var fd = (new FormData(this.el.dom)).entries(); + var ret = {}; + var ent = fd.next(); + while (!ent.done) { + ret[ent.value[0]] = ent.value[1]; // not sure how this will handle duplicates.. + ent = fd.next(); + }; + return ret; + } var fs = Roo.lib.Ajax.serializeForm(this.el.dom); diff --git a/roojs-all.js b/roojs-all.js index 3731df19c7..2ad2d49b7a 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1935,11 +1935,11 @@ Roo.MessageBox.confirm("Change requires confirmation",A.result.errorMsg,function i