I made a Magento Admin form before and it was ok. But with help of this tutorial, I added tabs to it. But in HTML output, I have two form tag. one of the has the content of the form and form key and the other just has the form key.
The problem is company_Vendor_Block_Adminhtml_Vendor_Edit_Form._prepareForm() is run two times. So it makes two form and I think, it runs two times because of this line in vendorController.EditAction()
$this->_addContent($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit'))
->_addLeft($this->getLayout()
 ->createBlock('vendor/adminhtml_vendor_edit_tabs'));
when I just have createBlock('vendor/adminhtml_vendor_edit') this is run only one-time but when I add the tab to left it is run two times. How Can I Solve It?
NOTE: My code is Exactly the same as the tutorial.
- 
 Welcome to SE. Pls specify your magento version.Priyank– Priyank2018年07月15日 03:14:51 +00:00Commented Jul 15, 2018 at 3:14
 
1 Answer 1
I found the solution.
The problem was about an extra(useless) XML layout file. So renderLayout() make an extra form.ithe problem can be solved by removing XML file from layout or just convert 
 $this->_addContent($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit'))->_addLeft($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit_tabs'));
TO
$this->_addLeft($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit_tabs'));