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.

I hope it will help you 😃.
Be the first to comment.