1

Is there a way to remove a checkbox label from above?

enter image description here

I looked into documentation, but i didn't find any similar example.

9
  • 1
    can you show the code that generates the checkbox?
    – Marius
    Commented Nov 17, 2016 at 8:56
  • I actually found this on their main documentation devdocs.magento.com/guides/v2.0/howdoi/checkout/…. So my code is this default checkout xml.
    – codeIT
    Commented Nov 17, 2016 at 9:00
  • magento 1.x or 2? Commented Nov 17, 2016 at 9:03
  • it's magento 2 .
    – codeIT
    Commented Nov 17, 2016 at 9:05
  • post your custom form code Commented Nov 17, 2016 at 9:08

2 Answers 2

2

You need to Remove lable item from your code

Remove below Line :

<item name="label" xsi:type="string">Checkbox Field</item>

Below is Complete code :

<item name="checkbox_field" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/boolean</item>
                    <item name="config" xsi:type="array">
                        <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
                        <item name="customScope" xsi:type="string">customCheckoutForm</item>
                        <item name="template" xsi:type="string">ui/form/field</item>
                        <item name="elementTmpl" xsi:type="string">ui/form/element/checkbox</item>
                    </item>
                    <item name="provider" xsi:type="string">checkoutProvider</item>
                    <item name="dataScope" xsi:type="string">customCheckoutForm.checkbox_field</item>
                    <item name="sortOrder" xsi:type="string">3</item>
                </item>
1
  • Than both labels are gore and only checkbox is there. Is there a way to remove only one of them?
    – codeIT
    Commented Nov 17, 2016 at 12:43
1

Use this "description" instead of "label"
"label":

<item name="label">I accept the Terms of Use and Privacy Policy</item>


"description":

<item name="description" xsi:type="string">I accept the Terms of Use and Privacy Policy</item>

preference: https://github.com/magento/magento2/issues/12125

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.