Onclick action for submit_to_remote

http://tr.openmonkey.com/articles/2006/01 says that I can’t use :onclick
options for submit_to_remote method in rails from a view.

How do I perform javascript validations for such controls supporting
Ajax?

Regards,
Jatinder