开发者

how to control for loop

this is my code......initially alltextboxes is showing...if i click the next or prev button it works properly....but i want only two textboxes per each click so initialy should show two text box ..........how i get it........how to solve......

see for full code:http://jsfiddle.net/sankarss/gAVZ8/22/

function starts(values)
{

    maximum=values;
    var form = document.forms[0];
    var container = $("#sankar");
    container.empty();
    for (var i = 0; i < maximum; i++)  
     开发者_如何转开发   container.append('<fieldset style="width: 250px; height: 80px;"><legend>Files of ' +(i + 1) + ' / ' + maximum + '</legend><input type="text" name="name' + i + '" /><br /><br /><input type="text" name="topic' + i + '" /></fieldset>');

    goto(form, 0);
}


Simply put this code under the for() line:

if(i>=2){
    continue;
}

Ad@m

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜