How to send a form after conform validation

<form action="price.php" method="post">
<table>
    <tr>
        <td></td>
        <td><input type="text" name="goods"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type="text" name="price" id="price"></td>
    </tr>
    <tr><td colspan=2><input type="submit" id="submit"  value="submit"></td></tr>
</table>
</form>



 input id=price0conform"";"" 
js

ob = document.getElementById("submit");
function check(){
    if(document.getElementById("price").value == 0){
        var flag = window.conform(" are your sure price is 0 ?");
        if(flag){
            return true;
        }else{
            return false;
        }
    }
}
ob.addEventListener("click",check);
price.php    
<?php
echo "price is " . $_POST["price"];
?>

Why is the price input zero and the conform window not popup in the form?

Sep.12,2021

the confirmation box is window.confirm . F12 can help locate the dislocation

by reading more errors in console.
Menu