I would like to make this code work:
$('#ddl').change(function () {
$('#cont').html('');
var count = getCount($('#ddl').val())
for (var i = 0; i < count ; i++) {
var html = '<div class="display-row">' +
'<div class="display-label">' +
'Vrednost:' +
'</div>' +
'<div class="display-field">' +
'Od: @Html.TextBoxFor(model => model[i].Od) Do:@Html.TextBoxFor(model => model[i].Do)' +
'@Html.ValidationMessageFor(model => model[i].Do)' +
'</div>' +
'</div>';
$('#cont').append(html);
}
});
I just need do get the value of i
for model[i]
inside js loop.
How can i achieve that ?