Foros de discusión

Liferay 6.2 AUI dropdown validation

thumbnail
Aravinth Kumar, modificado hace 9 años.

Liferay 6.2 AUI dropdown validation

Regular Member Mensajes: 152 Fecha de incorporación: 26/06/13 Mensajes recientes
Hi,
I want to give required validation for aui dropdown.

And I tried,
<aui:select showEmptyOption="true" name="Name" label="Name">
<aui:option label="n1" value="n1"></aui:option>
<aui:option label="n2" value="n2"></aui:option>
<aui:validator name="required"/>
</aui:select>

But its not working.Can u please guide me.

Thanks in advance.
regards,
Aravinth
Esquare
thumbnail
Pankaj Kathiriya, modificado hace 9 años.

RE: Liferay 6.2 AUI dropdown validation

Liferay Master Mensajes: 722 Fecha de incorporación: 5/08/10 Mensajes recientes
AFAIK, aui:validator tag will not work directly with aui:select tag.

Kindly refer Form validator to add validation to your field.

Regards
thumbnail
Aravinth Kumar, modificado hace 9 años.

RE: Liferay 6.2 AUI dropdown validation

Regular Member Mensajes: 152 Fecha de incorporación: 26/06/13 Mensajes recientes
Thanks Pankaj,I will try with this
thumbnail
Robin Nagpal, modificado hace 9 años.

RE: Liferay 6.2 AUI dropdown validation

Junior Member Mensajes: 44 Fecha de incorporación: 18/11/14 Mensajes recientes
Add required attribute like

         <aui:select label="age" name="ageRange" required="true">
                <aui:option label="select-age-range" value="" />
                <aui:option label="under-18" value="UNDER_18" />
                <aui:option label="18-34" value="EIGHTEEN_TO_THIRTY_FOUR" />
                <aui:option label="35-54" value="THIRTY_FIVE_TO_FIFTY_FOUR" />
                <aui:option label="55-74" value="FIFTY_FIVE_TO_SEVENTY_FOUR" />
                <aui:option label="75-above" value="SEVENTY_FIVE_AND_ABOVE" />
            </aui:select>