Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-51307

aui:validator required is not working for checkbox

Details

    Description

      Having the next code in a aui-form:

      <aui:form>
      	<aui:input type="checkbox" name="hello">
      		<aui:validator name="required" />
      	</aui:input>
      	<aui:button type="submit" name="submit" />
      </aui:form>
      

      It's expected that the form will not be send onSubmit if the checkbox is not selected.

      Currently if the user clicks the submit button a javascript error is throught and the form is submitted.

      Note: The same validator works for other inputs, eg fort text.

      Steps to reproduce:

      1. deploy the attached auiform-portlet-6.2.0.1.war
      2. add the AUI Form portlet to a page
      3. click submit

      Attachments

        1. auiform-portlet-6.2.0.1.war
          24 kB
        2. fixed.png
          fixed.png
          11 kB
        3. reproduced.png
          reproduced.png
          15 kB

        Issue Links

          Activity

            People

              yvonne.han Yvonne Han
              jose.jimenez Jose Jimenez
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8 years, 12 weeks, 1 day ago

                Packages

                  Version Package
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M3