JSFiddle - React, Tailwind, and code Playground

HTML

<form method="POST" action="" id="agreeForm"  "name="Agree">

<a href="#" onClick="MyWindow=window.open('terms.php','MyWindow','toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,width=600,height=300'); return false;" style="text-decoration:none;color:red;"><b>Terms & Conditions</b></a>

<div id="err" style="color:green;"></div>
<INPUT name="agree" id="agree" value="1" type="checkbox"> I agree to terms and conditions
<input type="submit" name="submit" value="Accept">
</form>

JavaScript

$(document).ready(function() {
    $("#agreeForm").submit(function()
    {
        
        if (!$("#agree").is(':checked'))  
        {
        document.getElementById("err").innerHTML="you must agree to terms if you would like to access web";
                  return false;
        
        } 
        else
        {
        
        var formdata = $(this).serialize();
        
        $.ajax({
                        type: "POST",
                        url: "free.php",
                        data: formdata,
                     });
                    return false;
        
        }
    });
});