title: How to cancel tab panel switch in RichFaces 3.3.x
body: <p>I need to do some basic validation on a form. The form data is broken up among 5 tabs, and the user should be able to submit the form from any tab. So far so good. If the user hasn't filled in a field, or has entered invalid data I want to stay on the current tab, display an error message and cancel the tab switch.</p>
  
  <p>I have tried the various events that I can find. Does anybody have any idea if this is possible and how I might achieve it? I would prefer to keep it on the client side in javascript if possible.</p>
  
  <p>Using a code sample such as below.</p>
  
  <pre><code>&lt;rich:tabPanel selectedTab="Info" switchType="client" contentClass="hz-record-tabpanel" ontabchange="doTabChange();"  onbeforeitemchange="doTabChange();" onbeforetabchange="doTabChange();"&gt;
                  &lt;rich:tab name="Info" label="Tab Label" onlabelclick="doTabChange();"&gt;
                      &lt;ui:include src="info.xhtml" /&gt;
                  &lt;/rich:tab&gt;
                  &lt;rich:tab name="Officers" label="Officers" onlabelclick="doTabChange();" ontableave="doTabChange();"&gt;
                      &lt;ui:include src="officers.xhtml" /&gt;
                  &lt;/rich:tab&gt;
                  &lt;rich:tab name="CardServices" label="Card Services" onlabelclick="doTabChange();"&gt;
                      &lt;ui:include src="cardservices.xhtml" /&gt;
                  &lt;/rich:tab&gt; 
                  &lt;rich:tab name="M2MLimits" label="M2M Limits" onlabelclick="doTabChange();"&gt;
                      &lt;ui:include src="m2mlimits.xhtml" /&gt;
                  &lt;/rich:tab&gt; 
                  &lt;rich:tab name="AccountServices" label="Account Services" onlabelclick="doTabChange();"&gt;
                      &lt;ui:include src="accountservices.xhtml" /&gt;
                  &lt;/rich:tab&gt;                 
              &lt;/rich:tabPanel&gt;
  </code></pre>
  
  <p>Any Ideas?</p>