Javascript not working after for loop is done
<p>I can't manage to make the line in the code <strong>with all the asterisks</strong> to work. Can anyone help? The function works fine, it is just the <code>document.write('This will not print');</code> that doesn't actually work. What is the problem?</p>

<p>//UPDATE//</p>

<p>First of all, thanks for the quick replies. Now I will post the full code.
As you can see the variable ii is declared at the body.</p>

<h2><strong>FULL CODE</strong></h2>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
function runThis() {
var fruta01 = document.getElementById('fruta').value;
var color01 = document.getElementById('color').value;
var problemo = true;
    for (newCount = 0; newCount&lt;=ii; newCount++){
            if (storeArray[newCount].match(fruta01) &amp;&amp; storeArray[newCount].match(color01)){
            document.write(storeArray[newCount]+'&lt;br/&gt;');
            problemo = false;
            };
    };
document.write('This doesnt print')
};

//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;script type="text/javascript"&gt;
&lt;!--

//Matriz total
var storeArray = new Array ()

//Numero de objetos
var ii = 0;

//Color de los objetos
var colorCounter = 0
var color = new Array ()
color[0] = 'verde';
color[1] = 'amarillo';

//tipo de objetos
var objectCounter = 0
var object = new Array ()
object[0] = 'limones';
object[1] = 'platanos';
object[2] = 'manzanas';



for (ii; ii&lt;8; ii++) {
storeArray[ii] = 'Tengo ' + ii + ' ' + object[objectCounter] +' de color ' + color[colorCounter];

        if (objectCounter != 2) {
        ++objectCounter
        }else{
        objectCounter = 0   
        }
        if (colorCounter != 1) {
        ++colorCounter
        }else{
        colorCounter = 0    
        }
} 

//print array so that you may see what you can choose...
for(var i=0;i&lt;storeArray.length;i++){
document.write(storeArray[i]+"&lt;br&gt;");
}

//--&gt;
&lt;/script&gt;

&lt;form&gt;
Que fruta buscas? &lt;input type="text" size="10" id='fruta'/&gt;&lt;br /&gt;
De que color? &lt;input type="text" size="10" id='color'/&gt;&lt;br /&gt;
&lt;input type="submit" value="Submit!" onclick="runThis()"/&gt;
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
