Form level validations

How to implement form level validations?

For example i have two fields in my form as email id and confirm email id. On submit i need to make sure that these two matches.

I could not find anything in book for form level stuff.

Vik
http://adfjsf.blogspot.com

You should make both fields immediate (setImmediate(true)), and add valueChangeListeners to those fields. Then in that listener, check the values and set proper errors if needed.

setting the form like subscribeform.setImmediate(true); makes it same as independent field level listeners?

or do i need to explicitly do the both?