for some reason isset($_post) doesn't work when i use js form.submit() how i can resolve that without changing type of input from button to submit and just with using vanilla javascript because i need both of them.
code html:
<form name="user_verification" action="action.php" method="POST">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="button" onclick="myFunction(this)" name="button" value="submit">
</form>
and here is the php script in action.php file
if($_SERVER['REQUEST_METHOD']=="POST")
{
if(isset($_POST['button']))
{
echo 'yes';
}else{
echo 'no';
}
}
and here is the javascript in action.js file
function myFunction(button)
{
//some code
const form=button.parentNode;
form.submit();}
onclick="myFucntion(this)"should be `onclick="myFunction1(this)"