maybe it's not parsing the attribute correctly? try adding quotes around it.
<set i='i+1' />
Another thing to consider is using one of the iterator autovariables to know what the index is. Just add the suffix Index to the iterating var, like:
<div each="var x in Model">
<input name='field-${xIndex}' value='${x.Id}'/>
</div>