how can concatenate the set variable in a for loop to be use as name in an input to get the value?
<p>how can concatenate the set variable in a for loop to be use as name in an input to get the value?</p>

<pre><code>&lt;script&gt;
var k=0;
var counter = 50;

    for(k=0; k&lt;=counter; k++){
        var choices = $('input[name=choices'+ k]).val();
        var choices = choices.replace(/\ /g, '%');
        var choices_ = choices_ +";"+ choices;
    }
   alert(choices);
&lt;/script&gt;
</code></pre>

<p>there are multiple input field namely choices1,choices2 and so on.
how can i get the value of those fields using for loop?
how can i concatenate the name choices and the variable k?
can you help me solve this problem??</p>
