I have two fields using the same name. When using Google Chrome to POST these two input fields to an ASP.NET MVC controller, the input field that appears closest to the top of the page takes precedence. This is a desired behaviour but can I safely assume that this behaviour will be consistent with older browsers that are as old as IE6?
Share
You can have multiple fields with the same name, but yes, as you noticed the 1st will override the others (you may be able to read them, depending on your server software, I don’t know ASP.NET).
If you want, you can add
[]to the name to make it an array.I don’t know about ASP.NET, but in PHP
$_POST['input']will now be an array.