<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Radio buttons cannot be selected by clicking the label in modal dialogs</title>
  <link rel="self" href="https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122841675" />
  <subtitle>Radio buttons cannot be selected by clicking the label in modal dialogs</subtitle>
  <id>https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122841675</id>
  <updated>2026-04-09T12:20:03Z</updated>
  <dc:date>2026-04-09T12:20:03Z</dc:date>
  <entry>
    <title>RE: Radio buttons cannot be selected by clicking the label in modal dialogs</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122931777" />
    <author>
      <name>Jamie Sammons</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122931777</id>
    <updated>2024-09-12T17:43:53Z</updated>
    <published>2024-09-12T17:43:51Z</published>
    <summary type="html">&lt;p&gt;Bug Report Created: https://liferay.atlassian.net/browse/LPD-36274&lt;/p&gt;</summary>
    <dc:creator>Jamie Sammons</dc:creator>
    <dc:date>2024-09-12T17:43:51Z</dc:date>
  </entry>
  <entry>
    <title>Radio buttons cannot be selected by clicking the label in modal dialogs</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122841674" />
    <author>
      <name>Jan Tošovský</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122841674</id>
    <updated>2024-08-15T11:26:50Z</updated>
    <published>2024-08-15T11:26:47Z</published>
    <summary type="html">&lt;p&gt;I am trying to construct a simple feedback dialog with multiple
  options. It is rendered as expected, however, radio buttons can only
  be selected by clicking the button part, not the label.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;&amp;lt;%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %&amp;gt;
&amp;lt;%@ taglib uri="http://liferay.com/tld/clay" prefix="clay" %&amp;gt;

&amp;lt;div id="dialog" style="display: none"&amp;gt;
    &amp;lt;aui:form&amp;gt;
        &amp;lt;div style="display: flex; margin-bottom: 2em"&amp;gt;
            &amp;lt;aui:input type="radio" name="category" label="Satisfied" value="0"&amp;gt;&amp;lt;/aui:input&amp;gt;
            &amp;lt;aui:input type="radio" name="category" label="Incorrect" value="1"&amp;gt;&amp;lt;/aui:input&amp;gt;
            &amp;lt;aui:input type="radio" name="category" label="Incomplete" value="2"&amp;gt;&amp;lt;/aui:input&amp;gt;
            &amp;lt;aui:input type="radio" name="category" label="Unclear" value="3"&amp;gt;&amp;lt;/aui:input&amp;gt;
            &amp;lt;aui:input type="radio" name="category" label="Irrelevant" value="4"&amp;gt;&amp;lt;/aui:input&amp;gt;
            &amp;lt;aui:input type="radio" name="category" label="Other" value="5"&amp;gt;&amp;lt;/aui:input&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;aui:input type="textarea" name="feedback" label="Comments" resizable="false"&amp;gt;&amp;lt;/aui:input&amp;gt;
    &amp;lt;/aui:form&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;clay:button id="feedback-button" icon="comments" label="Feedback" displayType="secondary" /&amp;gt;

&amp;lt;script&amp;gt;

document.getElementById("feedback-button").addEventListener("click", () =&amp;gt; {

    Liferay.Util.openModal({
        bodyHTML: document.getElementById("dialog").innerHTML,
        buttons: [
            {
                displayType: 'secondary',
                label: 'Cancel',
                type: 'cancel',
            },
            {
                displayType: 'primary',
                label: 'Submit',
                onClick: ({processClose}) =&amp;gt; {
                    /* perform operation and then close dialog */
                    // TODO
                    processClose();
                },
            },
        ],
        title: "Feedback"
    })
})

&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As a workaround, I have the feedback code on a separate JSP page,
  which is loaded into dialog using&amp;nbsp;Liferay.Util.openWindow() javascript
  method. However, this is suboptimal as I need to pass lots of render
  params to that page (and there is a risk some will be trimmed by URL
  length limitation), and also Cancel/Submit buttons are part of that
  page and do not stick at the bottom of the dialog.&lt;/p&gt;
&lt;p&gt;I suppose there are other workarounds, but I expect the original
  approach should work as well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LR 7.4.3.59&lt;/p&gt;</summary>
    <dc:creator>Jan Tošovský</dc:creator>
    <dc:date>2024-08-15T11:26:47Z</dc:date>
  </entry>
</feed>
