[ad_1]
Id should be unique, use a class instead.
<input class="path"/>
<input class="path"/>
$('.path').val("123");
And when you are setting a common value by using a class selector, there is no need to iterate.
[ad_2]
solved for each element with this id jquery