Answers.Body: <p>I would create a custom extension as explained <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension" rel="nofollow">here</a> or using an existing one and implementing <code>hook_civicrm_buildForm</code></p>
  
  <p><strong>Updated</strong></p>
  
  <pre><code>function myextension_civicrm_buildForm( $formName, &amp;$form ) {
    if ("CRM_Group_Form_Edit" == $formName) {
      if ($form-&gt;getAction() == CRM_Core_Action::ADD) {
        $defaults = array ("group_type[2]" =&gt; true);
        $form-&gt;setDefaults($defaults);
      }
    }
  }
  </code></pre>
  
  <p>That will make the <em>Mailing list</em> checkbox checked by default.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-21T18:39:57.007Z
Answers.Text: works like a charm, thx
Answers.UserDisplayName: nielo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-17T10:08:03.963Z
Answers.Text: This leads to checked ćheckbox when editing existing groups too – which looks like if a non-mailinglist were a mailinglist.
Answers.UserDisplayName: nielo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-17T10:20:57.263Z
Answers.Text: Re-accepted :) Thanks a load!
Answers.UserDisplayName: nielo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-21T17:00:20.820Z
Answers.LastActivityDate: 2016-03-17T10:17:47.047Z
Answers.LastEditDate: 2016-03-17T10:17:47.047Z
Answers.UserDisplayName: Andrei
Body: <p>I wonder how I may preset the mailinglist group type checkbox in group's edit form for new groups.</p>
  
  <p>From a quick glance to code and db I assume that the is_default field in the db is not used here (have tried also).</p>
  
  <p>So how could I do if I want to avoid a client side/js hack?</p>
  
Tags: <groups><forms><ui>
Title: Best way to make new groups mailinglists by default
ThreadText: # Best way to make new groups mailinglists by default
  
  (Asked by: username_0 on 2016-01-21)
  
  I wonder how I may preset the mailinglist group type checkbox in group's edit form for new groups.
  
  From a quick glance to code and db I assume that the is\_default field in the db is not used here (have tried also).
  
  So how could I do if I want to avoid a client side/js hack?
  
  **Tags:** groups, forms, ui
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-01-21. Score: 5 | Accepted answer
  
  I would create a custom extension as explained here or using an existing one and implementing hook_civicrm_buildForm
  Updated
  function myextension_civicrm_buildForm( $formName, &$form ) {
    if ("CRM_Group_Form_Edit" == $formName) {
      if ($form->getAction() == CRM_Core_Action::ADD) {
        $defaults = array ("group_type[2]" => true);
        $form->setDefaults($defaults);
      }
    }
  }
  
  That will make the Mailing list checkbox checked by default.
  
  > **Comments:**
  > **username_0**: works like a charm, thx  
  > **username_0**: This leads to checked ćheckbox when editing existing groups too – which looks like if a non-mailinglist were a mailinglist.  
  > **username_0**: Re-accepted :) Thanks a load!  
  
  ---
  
  