Javascript operator issue. Value needs to be at least 4 and an even number
<p>I am updating an old script by adding RAID 10 configuration.</p>

<p>However I cannot get it to function properly. The best I could achieve is below.</p>

<pre><code>if (parseInt(document.form_config.txtNumberOfDisks.value)%2 != 0 &amp;&amp; strRaidType == "RAID10") {
    strRaidType = "uRAID10";
}
</code></pre>

<p>This works, but also allows a 2 disk setup in with RAID 10. Obviously this is incorrect, because RAID 10 needs at least 4 disks (and an equal amount).</p>

<p>I already tried changing %2 to %4, but that requires multiples of 4 disks, so that's incorrect.</p>

<p>Any ideas?</p>