Reading list Switch to dark mode

    Add Button In Admin Form Magento 2

    Updated 6 January 2023

    Add Button In Admin Form Magento 2 : if you want to add a button in admin form. here is a way you can do it. please check below code.

    $fieldset->addField(
        'phone_number',
        'text',
        [
            'label' => __('Phone Number'),
            'title' => __('Phone Number'),
            'name' => 'phone_number',
            'after_element_html' => '<button class="primary" type="button">Verify</button>'
        ]
    );

    It will look like this. Check the below screenshot.

    Selection_012

    I hope it will help you 😃.

    Searching for an experienced
    Magento 2 Company ?
    Find out More
    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home