As it was not clear I will redo the doubt.
follow the code that works as desired.
<html>
<head>
<title>Teste</title>
</head>
<body>
<form action="/teste_andre.html" method="get" id="form1" onsubmit="return valida()">
<input type='hidden' value='1' name='teste' id='teste'>
</form>
<button type="submit" form="form1" value="Submit">Submit</button>
<script type="text/javascript">
function valida(){alert('valida');}
</script>
</body>
</html>
If I change the ID of the field type hidden from 'test' to 'validate' It does NOT show the alert and it does not give an error in the console.
I just want to know why hidden can not have the same id of the function name?