looping through dynamically created controls in jquery
<p>I'm trying to use the following loop to loop through dynamically created controls on my web form:</p>

<pre><code>            for(x = 0; x &lt;= count; x++) {
                Stmt += $("#DDLColumns" + x).val();
                switch($("#DDLConditional" + x).val()) {
                    case "is equal": Stmt += " = ";
                        break;
                    case "begins with": Stmt += " LIKE '%";
                        break;
                    };
                Stmt += $("#WhereText" + x).val();
                Stmt += ", ";
            }
</code></pre>

<p>and this is producing undefined and nulls as output from the val() functions. What am I doing wrong here?</p>
