Hi there, i have a webpage which takes in user details to store them into a database. i have 2 files html and php. the html file takes the input and sends it to the php file. when the html sends data to php the browser changes to the php file however i would like to stop this happening. when the input is not correct and the submit button is clicked on i would like to stop the html sending data to the php and to stay as it is with the incorrect data.

i have been told that AJAX is the solution to this problem as AJAZ can check the data in the background without changing the webpage. i am totaly new to AJAX and was hoping someone would please give me some guidance.

e.g.
<form action="http://localhost/PATIENT/filename.php" method="post" name="name" id= "name" onsubmit"error checks">
<input name="abc" type="text"/>
<input type="text" name="xxx"/>
</form>

<?php
database connection....
$abc = $_POST['abc'];
$xxx = $_POST['xxx'];
?>