diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index 3b55802f38..a31da2529d 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -564,6 +564,30 @@ function insertConfirmButton(options) { } +/* + * Extract all specified form values as a single object + */ +function extractFormData(fields, options) { + + var data = {}; + + for (var idx = 0; idx < options.field_names.length; idx++) { + + var name = options.field_names[idx]; + + var field = fields[name] || null; + + if (!field) continue; + + if (field.type == 'candy') continue; + + data[name] = getFormFieldValue(name, field, options); + } + + return data; +} + + /* * Submit form data to the server. *