const isRepeated = (i, id, arr) => arr.indexOf(i) !== id || arr.indexOf(i, id + 1) !== -1;
...
[1,2,3,4,1,3].map(isRepeated);
<form action="someMethod.php">
<p><input type="text" name="name" value="Вася"></p>
<p><input type="submit"></p>
</form>