0

I have created a custom form in admin and added a image upload field in the form. When we edit a form having uploaded image in it, it shows preview of that image as small thumbnail. enter image description here After clicking on that preview image, image opens in same tab but I want it to open in new tab. Can anyone help me here.

below is my code : app/code/Vendor/Module/Block/Adminhtml/Grid/Edit/Form.php

$fieldset->addField(
            'file',
            'image',
            [
                'name' => 'file',
                'label' => __('File Upload'),
                'id' => 'file',
                'note' => 'Allowed File Types are .jpg , .jpeg, .png, .pdf ',
            ]
        );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.