title: XPages setting class of radio group (for required validation)
body: <p>I need to make a Radio Group have class of "required" so I can use the jQuery Validation plugin, I've tried the suggestions are per <a href="https://stackoverflow.com/questions/12191078/how-to-validate-radiorequired-via-jquery">here</a></p>
  
  <p>This is field:</p>
  
  <pre><code>        &lt;div data-role="fieldcontain"&gt;
              &lt;fieldset data-role="controlgroup" data-type="horizontal"&gt;
                  &lt;legend class="ui-input-text"&gt;Compliant?&lt;/legend&gt;
  
                  &lt;xp:radioGroup id="CLCompliant"
                      value="#{docAuditCLAnswer.Compliant}"&gt;
  
                      &lt;xp:selectItem itemLabel="Yes" itemValue="Yes"
                          id="CLCompliantYes"&gt;
                      &lt;/xp:selectItem&gt;
  
                      &lt;xp:selectItem itemLabel="No" itemValue="No"
                          id="CLCompliantNo"&gt;
                      &lt;/xp:selectItem&gt;
  
                      &lt;xp:selectItem itemLabel="N/A" itemValue="NA"
                          id="CLCompliantNA"&gt;
                      &lt;/xp:selectItem&gt;
                  &lt;/xp:radioGroup&gt;
              &lt;/fieldset&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>I've tried the following as these isn't a styleClass property, but the attribute is ignored/not rendered:</p>
  
  <pre><code>                    &lt;xp:selectItem itemLabel="Yes" itemValue="Yes"
                          id="CLCompliantYes"&gt;
                          &lt;xp:this.attrs&gt;
                              &lt;xp:attr name="class" value="required"&gt;
                              &lt;/xp:attr&gt;
                          &lt;/xp:this.attrs&gt;
                      &lt;/xp:selectItem&gt;
  </code></pre>
  
  <p>I've also tried setting when the document is loaded, but can't select by name without hardcoding the view:_id, is there an equivalent to the x$ XSnippet?</p>
  
  <pre><code>$('input:radio[name="view:_id1:CLCompliant"]').addClass("required");
  </code></pre>