hi can anyone tell me how we can use js for server side validations also?
If by "js" you mean Javascript then that's not possible. Javascript runs on the client side and that is that.
AJAX allows a Javascript function to call a server side script and use the result as if the result were returned by the Javascript function itself.
You can get more details about this in the
Javascript/Ajax forum.