Extracting relevant form data to an array
You're failing to use the power of jQuery selectors, making the problem much harder than it needs to be.

Furthermore, elmClass = input.attr('class') is buggy.  The elmClass variable is not localized.  If the element (and all previously match elements!) has no class attribute, then the .indexOf() tests will crash.

Since input could be either an &lt;input&gt; or a &lt;textarea&gt;, I'd prefer a more generic variable name.



var tableName = 'some-table';

var objOutgoingData = jQuery(
       'input.form-control[name]:visible,' +
       'textarea.form-control[name],' +
       'textarea.question_textarea_input[name]')
  .not('.element_reference_input')
  .map(function() {
    var $element = jQuery(this);
    return {
        name:  $element.attr('name').split('.').pop(),
        value: $element.val(),
        table: tableName,
    };  
}).get();

jQuery('#output').focus(function() {
    $(this).val(
        JSON.stringify(objOutgoingData)
            .replace(/[{\]]/g, '\n$&amp;')
    );
});
input, textarea { font-family: monospace; background-color: #f99; }
.incl { background-color: #9f9; }
#output { background-color: inherit; }
&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;form&gt;
  &lt;textarea id="output" rows="6" cols="80"&gt;Click me to generate objOutgoingData.
Green elements are to be included; red ones and invisible ones excluded.
&lt;/textarea&gt;

  &lt;input type="text"   name="input.noclass"                           value="untyped input (no class)"&gt;
  &lt;input               name="input.untyped" class="incl form-control" value="untyped input (form-control)"&gt;
  &lt;input type="text"   name="input.text"    class="incl form-control" value="text input (form-control)"&gt;
  &lt;input type="hidden" name="input.hidden"  class="excl form-control" value="hidden input (form-control)"&gt;

  &lt;textarea               name="textarea"         class="incl question_textarea_input"&gt;textarea (question_textarea_input)&lt;/textarea&gt;
  &lt;textarea type="hidden" name="textarea.hidden"  class="excl"&gt;textarea (wrong class)&lt;/textarea&gt;
&lt;/form&gt;