function fromTextInput(inputs, jsonData, alterDataFunc) {
  // edit input text values, depending on name
  for (let i = ZERO; i < inputs.length; i++) {
    const name = inputs[i].name;
    const lastIndex = name.lastIndexOf('_');
    const key = name.substring(ZERO, lastIndex);

    // get the number after _
    const index = parseInt(name.substring(lastIndex + ONE, name.length), 10);

    if (inputs[i].getAttribute('type') === 'text' && key) {
      delete jsonData[name]; // ie. okRange_1
      const intVal = alterDataFunc ?
        alterDataFunc(inputs[i].value) : inputs[i].value;
      if (intVal) { // add to array only if value is truthy
        if (!jsonData[key]) {
          jsonData[key] = [];
        }

        jsonData[key][index] = intVal; // ie. 1, 2, 12.45
      }
    }
  }

  return jsonData;
}
/**
 * Return JSON from text inputs with _ in them
 * @param {Array} inputs The input DOM elements
 * @param {Object} jsonData Contains input names and values
 * @param  {Func} alterDataFunc Optional function to
 * alter input value.
 * @returns {Object} jsonData The updated input values
 */
Return JSON from text inputs with _ in them
@param {Array} inputs The input DOM elements
@param {Object} jsonData Contains input names and values
@param  {Func} alterDataFunc Optional function to
alter input value.
@returns {Object} jsonData The updated input values
Return JSON from text inputs with _ in them @param { Array } inputs The input DOM elements @param { Object } jsonData Contains input names and values @param { Func } alterDataFunc Optional function to alter input value . @returns { Object } jsonData The updated input values
function fromTextInput(inputs, jsonData, alterDataFunc) {
  for (let i = ZERO; i < inputs.length; i++) {
    const name = inputs[i].name;
    const lastIndex = name.lastIndexOf('_');
    const key = name.substring(ZERO, lastIndex);
    const index = parseInt(name.substring(lastIndex + ONE, name.length), 10);
    if (inputs[i].getAttribute('type') === 'text' && key) {
      delete jsonData[name]; 
      const intVal = alterDataFunc ?
        alterDataFunc(inputs[i].value) : inputs[i].value;
      if (intVal) { 
        if (!jsonData[key]) {
          jsonData[key] = [];
        }
        jsonData[key][index] = intVal; 
      }
    }
  }
  return jsonData;
}
function fromTextInput ( inputs , jsonData , alterDataFunc ) { for ( let i = ZERO ; i < inputs . length ; i ++ ) { const name = inputs [ i ] . name ; const lastIndex = name . lastIndexOf ( '_' ) ; const key = name . substring ( ZERO , lastIndex ) ; const index = parseInt ( name . substring ( lastIndex + ONE , name . length ) , 10 ) ; if ( inputs [ i ] . getAttribute ( 'type' ) === 'text' && key ) { delete jsonData [ name ] ; const intVal = alterDataFunc ? alterDataFunc ( inputs [ i ] . value ) : inputs [ i ] . value ; if ( intVal ) { if ( ! jsonData [ key ] ) { jsonData [ key ] = [ ] ; } jsonData [ key ] [ index ] = intVal ; } } } return jsonData ; }
Return JSON from text inputs with _ in them
 @param {Array} inputs The input DOM elements
 @param {Object} jsonData Contains input names and values
 @param  {Func} alterDataFunc Optional function to
 alter input value.
Return JSON from text inputs with _ in them @param { Array } inputs The input DOM elements @param { Object } jsonData Contains input names and values @param { Func } alterDataFunc Optional function to alter input value .
// edit input text values, depending on name // get the number after _ // ie. okRange_1 // add to array only if value is truthy // ie. 1, 2, 12.45