ExtJS Prevent validation for form fields with display: none
<p>I want to prevent validation for form fields with <code>display: none</code>.</p>

<p>For example fields with <code>ipv6</code> set to <code>display: none</code>, I dont want to check this fields with form <code>isValid()</code> method.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var form = new Ext.form.FormPanel({
  frame: true,
  bodyStyle: 'padding:5px 5px 0;',
  items: [{
    xtype: 'radiogroup',
    id: 'ip_type',
    fieldLabel: 'IPType',
    columns: 2,
    items: [{
      boxLabel: 'IPv4',
      name: 'ip_type',
      inputValue: 'ipv4',
      checked: true
    }, {
      boxLabel: 'IPv6',
      name: 'ip_type',
      inputValue: 'ipv6'
    }],
    listeners: {
      'change': function(radioGroup, checkedRadio) {
        if (checkedRadio.inputValue == 'ipv4') {
          Ext.fly('ip').setStyle({
            display: 'block'
          });
          Ext.fly('ipv6').setStyle({
            display: 'none'
          });
          Ext.getCmp('ip').enable();
          Ext.getCmp('ipv6').disable();
        } else {
          Ext.fly('ip').setStyle({
            display: 'none'
          });
          Ext.fly('ipv6').setStyle({
            display: 'block'
          })
          Ext.getCmp('ip').disable();
          Ext.getCmp('ipv6').enable();
        }
      }
    }
  }, {
    id: 'ip',
    layout: 'column',
    border: false,
    hideBorders: true,
    items: [{
      layout: 'form',
      items: [{
        fieldLabel: 'IP',
        xtype: 'ipv4field',
        name: 'ip',
        allowBlank: false,
        regex: ipv4_reg,
      }]
    }, {
      html: '/'
    }, {
      xtype: 'numberfield',
      name: 'netmask',
      allowBlank: false,
      allowDecimals: false,
      minValue: 0,
      maxValue: 32,
      width: 70
    }]
  }, {
    id: 'ipv6',
    layout: 'column',
    border: false,
    hideBorders: true,
    items: [{
      layout: 'form',
      items: [{
        fieldLabel: 'IP',
        xtype: 'textfield',
        name: 'ipv6',
        allowBlank: false,
        regex: ipv6_reg,
      }]
    }, {
      html: '/'
    }, {
      xtype: 'numberfield',
      name: 'netmaskipv6',
      //allowBlank: false,
      allowDecimals: false,
      minValue: 0,
      maxValue: 128,
      width: 70
    }]
  }]

});</code></pre>
</div>
</div>
</p>

<blockquote>
  <p></p>
</blockquote>