Answers.Body: <p>I figured it out.</p>
  
  <p>When creating the array for the tab, add "ajaxForm" to the "class" index.</p>
  
  <pre><code>$newTab = array(
    'title' =&gt; 'New Tab',
    'link' =&gt; 'url',
    'class' =&gt; 'ajaxForm', //&lt;---- The important part
    //etc
  );
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-28T16:26:05.920Z
Answers.LastActivityDate: 2017-06-28T16:26:05.920Z
Answers.UserDisplayName: Squishus Tyrannicus
Body: <p>I'm creating a custom tab for events. I've used hook_civicrm_tabset to add a tab to the event management pages. In that tab, I have a form generated using civix. Upon saving the form, my operations are successfully completed and I'm redirected back to the event management "Info and Settings" tab. I would like to end up back on the same tab instead.</p>
  
  <p>How do I end up back in my custom tab after submitting my form?</p>
  
Tags: <forms>
Title: How do I redirect back to the same tab after submitting a form?
ThreadText: # How do I redirect back to the same tab after submitting a form?
  
  (Asked by: username_0 on 2017-06-28)
  
  I'm creating a custom tab for events. I've used hook\_civicrm\_tabset to add a tab to the event management pages. In that tab, I have a form generated using civix. Upon saving the form, my operations are successfully completed and I'm redirected back to the event management "Info and Settings" tab. I would like to end up back on the same tab instead.
  
  How do I end up back in my custom tab after submitting my form?
  
  **Tags:** forms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-06-28. Score: 1
  
  I figured it out.
  When creating the array for the tab, add "ajaxForm" to the "class" index.
  $newTab = array(
    'title' => 'New Tab',
    'link' => 'url',
    'class' => 'ajaxForm', //<---- The important part
    //etc
  );
  
  
  ---
  
  