cancel
Showing results for 
Search instead for 
Did you mean: 

how to set required on input field form in ui_component

SOLVED

how to set required on input field form in ui_component

i want to set required on input field in ui_component form. below is my form field code

<field name="title">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string">Some text</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">sampleform</item>
                </item>
            </argument>
        </field>

   thanks in advance..

Find helpful ? Consider Giving Kudos to this post.
Problem solved? Click Accept as Solution!"
Qaisar Satti
1 ACCEPTED SOLUTION

Accepted Solutions

Re: how to set required on input field form in ui_component

after many search i find solution i was missing

 

<item name="validation" xsi:type="array">
     <item name="required-entry" xsi:type="boolean">true</item>
</item>

after that complete code for input field

<field name="title">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string">Some text</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">sampleform</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
           </argument>
 </field>
Find helpful ? Consider Giving Kudos to this post.
Problem solved? Click Accept as Solution!"
Qaisar Satti

View solution in original post

1 REPLY 1

Re: how to set required on input field form in ui_component

after many search i find solution i was missing

 

<item name="validation" xsi:type="array">
     <item name="required-entry" xsi:type="boolean">true</item>
</item>

after that complete code for input field

<field name="title">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string">Some text</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">sampleform</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
           </argument>
 </field>
Find helpful ? Consider Giving Kudos to this post.
Problem solved? Click Accept as Solution!"
Qaisar Satti