<div style="display:none">
<input type='text' name='test_val' value='5'>
</div>
<div>
<input type='text' name='test_val' value='10'>
</div>
Hiding field in any way won't hide the value. If you want to prevent value from being sent, your field has to have "disabled" attribute. If you want to access both fields values (and have a same name) then you have to update your names. For example:
<div style="display:none">
<input type='text' name='test_val[]' value='5'>
</div>
<div>
<input type='text' name='test_val[]' value='10'>
</div>
Then, in PHP you can access your field values:
$_POST['test_val'][0] == 5
$_POST['test_val'][1] == 10