I have made custom module in admin for add/edit and delete.
For a particular field (example email ) in the edit form, I want to show HTML instead of an edit input field.
For example, I am saving values in the database for column email as [email protected],[email protected].
When a user edits that form I want to show custom HTML like below
<table>
<tr>
<th>EMail</th>
</tr>
<tr>
<td>[email protected]</td>
</tr>
<tr>
<td>[email protected]</td>
</tr>
</table>
for applying the custom function to edit field where should I do changes, below is code of Main.php
Vendor/Magento/Block/Adminhtml/Trulookadmin/Edit/Tab/Main.php
protected function _prepareForm()
{
/* @var $model \Obl\Trulookadmin\Model\BlogPosts */
$model = $this->_coreRegistry->registry('formadmin');
$isElementDisabled = false;
/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create();
$form->setHtmlIdPrefix('page_');
$fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Item Information')]);
if ($model->getId()) {
$fieldset->addField('id', 'hidden', ['name' => 'id']);
}
$fieldset->addField(
'email',
'text',
[
'name' => 'email',
'label' => __('EMail'),
'title' => __('EMail'),
'disabled' => true
]
);