I have a web form on a HTML page and a JavaScript file that is lived to that page.
The JavaScript file preforms some validation on the form, so that when a text box is selected a help message is shown, if it is left empty anouther message is shown.
The form (using the post method) is then sent to a PHP file to add its contents to a database. Although the JavaScipt file is letting the user know in real time if the fields of the form are incorrect or left blank, once the submitt button is clicked the PHP page is called and the data is added to the batabase, even if there is a problem with the validation.
What I want is when the button is clicked, if there is a problem, the messages stay there, possiably anouther new message shown and the page does not leave the current one and go to the PHP one to add to the database.
Any ideas?