title: Validation Cant Show on Last Option Radio Button with Bootstrap 4
body: <p>I have a radio button with Bootstrap 4, but when i using validation this error message show on below of first option radio button. How to show it on below of last option radio button?</p>
  <p>Screenshot
  <a href="https://i.stack.imgur.com/ujmJr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ujmJr.png" alt="enter image description here" /></a></p>
  <p>HTML Code</p>
  <pre><code>&lt;div class=&quot;form-group&quot;&gt;
    &lt;div class=&quot;row&quot;&gt;
      &lt;legend class=&quot;col-form-label col-md-2 offset-2 pt-0 pr-0&quot;&gt;Sudah pernah daftar? &lt;span class=&quot;text-danger&quot;&gt;*&lt;/span&gt;&lt;/legend&gt;
      &lt;div class=&quot;col-md-6&quot;&gt;
        &lt;div class=&quot;form-check&quot;&gt;
          &lt;input class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;is_registered&quot; id=&quot;option1&quot; value=&quot;Belum&quot; required=&quot;&quot;&gt;
          &lt;label class=&quot;form-check-label&quot; for=&quot;option2&quot;&gt;
            Belum
          &lt;/label&gt;
        &lt;/div&gt;
        &lt;div class=&quot;form-check&quot;&gt;
          &lt;input class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;is_registered&quot; id=&quot;option2&quot; value=&quot;Sudah&quot; required=&quot;&quot;&gt;
          &lt;label class=&quot;form-check-label&quot; for=&quot;option1&quot;&gt;
            Sudah
          &lt;/label&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Javascript Code</p>
  <pre><code>errorElement: &quot;em&quot;,
  keyUp: true,
  errorPlacement: function ( error, element ) {
    // Add the `help-block` class to the error element
    error.addClass('invalid-feedback');
  
    if (element.prop('type') === 'checkbox') {
      error.insertAfter(element.parent('label'));
  
    } else if (element.prop('type') === 'radio') {
      error.insertAfter(element.next('label'));
      $('.invalid-feedback').css(&quot;display&quot;, &quot;block&quot;);
      
    } else if (element.hasClass('select2') &amp;&amp; element.next('.select2-container').length) {
      error.insertAfter(element.next('span'));
  
    } else {
      error.insertAfter(element);
    }
  },
  </code></pre>