Autofill works with name attribute of the input, so if you set a name for an input like "firstname", chrome will fill it.
If you want to disable it, use an odd name like "supermanname".
Javascript can't solve your problem.
Second solution: You can make your inputs hidden with the same names, and set their values with other inputs. I simplified the Js with jQUery.
<form action="handlerfile.php" method="post">
<input type="text" id="1" onclick="$("#2").val($("#1").val())"/>
<input type="hidden" name="username" id="2">
</form>