From e58be43126ffac15e741dd55fe06f9ffad182689 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 17 Jun 2014 17:31:40 +0200 Subject: [PATCH] LSform.js : add method getInput() and use it in method getValue() --- public_html/includes/js/LSform.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/public_html/includes/js/LSform.js b/public_html/includes/js/LSform.js index f7bafd6f..21d8464c 100644 --- a/public_html/includes/js/LSform.js +++ b/public_html/includes/js/LSform.js @@ -177,6 +177,17 @@ var LSform = new Class({ }, getValue: function(fieldName) { + var retVal = Array(); + var inputs = this.getInput(fieldName); + inputs.each(function(el){ + if (el.value!="") { + retVal.include(el.value); + } + },this); + return retVal; + }, + + getInput: function(fieldName) { var retVal = Array(); var ul = $(fieldName); if ($type(ul)) { @@ -190,11 +201,7 @@ var LSform = new Class({ LSdebug(name); if (name) { if (name[1]==fieldName) { - if ($type(el.value)) { - if (el.value!="") { - retVal.include(el.value); - } - } + retVal.include(el); } } },this);