Form validation is the process of checking that a form has been filled in correctly before it is processed.
For example, if your form has a box for the user to type their email address, you might want your form handler to check that they've filled in their address before you deal with the rest of the form.
This is simply part of the concept of progressive enhancement, whereby JS provides a mechanism for enhancing the experience for the user, if it's there and turned on, and hopefully makes their interaction with your site pleasant, or, at least, minimally irritating.
Edited in response to OP's question regarding 'where to download a JS validation tool.' While I can't -necessarily- recommend any one library (I tend to write my own as required, or borrow from previously self-written examples), a Google search threw these options up: Absolutely, client-side is merely a functional courtesy to your users, it should never be considered 'secure.' All user-submitted data should be validated and sanity-checked on the server-side before storing.
You should ALWAYS validate in PHP on the SERVER SIDE and validation in Java Script is CLIENT SIDE validation for user CONVENIENCE.
it sounds like a good idea to have it on the client side too. Do you know where I can download a validation script like that one in yahoo when you register an account?
This saves irritating page-reloads (since on submit the JS catches the event and validates the form, preventing form-submission if errors are found) and minimises the chances of their having to re-enter information again (and again and again...), or leaving prior to completing the form properly.