Ajax request in magento module
I developing magneto module, In this module i want to make a ajax request in admin panel.I don't understand were to add script and controllers.please help me.
My requirement:
When change the select box(On change) i want add some field in the form.
Mycode:
/app/code/local/<Namespace>/<Module>/Block/Adminhtml/<Module>/Edit/Tab/Form.php
$fieldset->addField('type', 'select', array(
'label'开发者_开发知识库 => Mage::helper('<Module>')->__('Article Type'),
'name' => 'status',
'values' => array(
array(
'value' => '',
'label' => Mage::helper('<Module>')->__('Choose'),
),
array(
'value' => 1,
'label' => Mage::helper('<Module>')->__('Normal'),
),
array(
'value' => 2,
'label' => Mage::helper('<Module>')->__('video'),
),
),
'required' => true
));
I am creating fields using this.
- How can i add another field on change.
- Where should i add script
- Where should i add controller
I created this module using this instructions
- Let this field always be on the form. But make it invisible and show when you need it.
- In the same template where the form is.
- Place controller in your module. On stackoverflow you can find many questions about creating your own magento module and controller.
精彩评论