0
As it was not clear I will remake the doubt.
follows the code that is run 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 Hidden field ID from 'test' to 'validate' Does NOT show Alert and does not error on console.
I just want to know why Hidden can’t have the same id as the function name?
shows the button code
– 13dev
Already took a look at the console ?
– Otto
Show the rest of the code to see how you are implementing this form
– Walmir Silva