I have the following form
<form id="postForm" action="post.php" method="post">
and a post.php file. Both of them are working properly. I just need to make sure that when I check the checkbox the form is submitted and when I don't, it should stay on the same page.I found a few tutorials using jquery and ajax, but I was required to use Javascript. Can anyone help, thank you in advanced
function validate() {
if(document.getElementById('postTW').checked){
document.getElementById("postForm").submit();
}
else{
}
}