jscript 'type' attribute
<p>Im trying to implement the following logic on javascript. </p>

<p>If type is 'bankAccountTypeId' get all fields with the same className as field using $(field.className) then use .each to loop through each result compare field.value with $(this).val() and use alert to show an error message if they are different (break if fail).</p>

<p>function onChange_productListField(field, type) {</p>

<pre><code>  if (HimmsJSUtil.elementHasClass(field, 'DC')) {

        var allProductGroupFields = $(".DC."+type);

        var value = field.value;

        if (field.options) {

              value = HimmsJSUtil.getSelectedDropDownOption(field);

        }

        allProductGroupFields.each(function(index) {

              if ($(this).attr("id") != field.id

                          &amp;&amp; !$(this).val()) {

                    $(this).val(value);

              }

        });

  } else {



        /* implement the logic here */

  }
</code></pre>

<p>}</p>

<p>My question is , how would the type attribute work, within this logic?  </p>
