boolean variable is acting weird
<p>First the code:</p>

<pre><code>function searchItems(){
var noParameters = new Boolean(0);
var formFields = $('form')[0].elements;
for(i=0;1&lt;formFields.length;i++){
    if(formFields[i].type == 'text'){
        if(!(formFields[i].value)){
            noParameters = 0;
        }
    }
}
alert(noParameters.valueOf());
}
</code></pre>

<p>This function is called on a form submit. It's purpose is to see if all form fields of type 'text' have no value (empty input boxes).</p>

<p>I do not get an alert when I think I should. The boolean variable is initialized when it is declared, so there is a value in it. The if statements all work as they should, I have checked repeatedly. The only error I have in my browser is "type is null or not an object" which is on the line comparing the form field type to 'text'.</p>

<p>I have tried different syntax for the alert with no success: noParameters.toString(), assigning noParameters.valueOf() to a variable and then alerting that, 'true' and 'false' instead of 0 and 1. Why does  my alert not show?</p>
