Ajax form validating
Server-side validation is when form data is submitted, server analyzes then returns the user back to the form when items are invalid.
Before we go into details, let's get a basic understanding of what we will be doing.
If not you should only have to recreate that function, not the cross variable and script blocks.
You probably wont even need the cross variable as you do indeed define it again on the next script "validatefields.js".
That said, if you just can't do what he is suggesting, then replace the last line of your before Submit with the code Fliespl has put up.
When in comes to validating forms, there are basically two techniques you can use: 1) Server-side validation and 2) Client-side validation.
One extra note: j Query is used throughout the Java Script files. Pass your DB instance to the validate_input function. That has got to be the largest function I've ever seen!