Currently for school I have to make a contact form with Javascript validation that will check whether name, email etc is filled in. If so, it has to run a php code to send the email ofcourse.
Right now I finished all the javascript validation, but I'm a bit stuck regarding on how to activate php code to send the email after the javascript validation is finished..
I'm not allowed to use anything else like AJAX, Jquery.. I've seen many posts about this, but they were all about these languages..
I wasn't planning about redirecting and using a landing page after submitting the form.
For this one, you need to reach back in history a bit and use techniques that predate AJAX. Basically, old-school forms from the 90's.
If you need help on how to do the steps, just do a bit more googling and you'll find plenty of details.
The AJAX techniques that libraries like JQuery use are also doing something similar to a form POST, however it's smarter in that you don't need to leave the page you're on. This was a new feature that browsers started to adopt over 10 years ago. My guess is your professor wants to teach you the fundamentals first before diving into the sophisticated stuff. Good luck!
Yes Its Possible You Can Just Use Some Css /Java Script Code And All Done
You Can Make 2 input type Of button And Set onlick and Call The JavaScript junction And Hide Button Using Css Display None Property And Click Button Using JavaScript When Validation Is Finished Using If else Condition
Like This
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<style>
input{display:none;}
</style>
<body>
<input type="submit" value="" id="test" onclick="name()">
<input type="submit" value="" id="test2" onclick="name2()">
<script>
if (new Date().getHours() > 18) {
document.getElementById("test").click();
}
else
{
document.getElementById("test2").click();
}
function name(){
alert('My Name Is Imtiyaz GO www.trickwordpress.in');
}
function name2(){
alert('for More Help Go "www.trckwordpress.in"');
}
</script>
</body>
</html>
</div>