1

I have create custom page in admin. Here am trying to save the some data to database.

I have doubt in form action this my code

.phtml

<form action="<?php echo Mage::helper("adminhtml")->getUrl("*/*/insertsilverrateAction") ?>" method="post" enctype="multipart/form-data">
    <input type="text" name="rate" value="10.10" required="">
    <button type="submit" name="save" class="scalable save"><span><span><span>Submit</span></span></span></button>
</form>

Controller

class JR_CreateAdminController_Adminhtml_CustomController extends Mage_Adminhtml_Controller_Action
{
    public function insertsilverrateAction()
    {
        echo 'h1';
    }
}

When i click submit button redirect to 404-page.

How can add correct form action

1
  • 1
    <?php echo Mage::helper("adminhtml")->getUrl("{routers-module}/createadmincontroller/insertsilverrateaction") ?>
    – Aamir
    Oct 9 '17 at 8:20
2

Change your form action to

<?php echo Mage::helper("adminhtml")->getUrl("your_adminhtml_router/custom/insertsilverrate") ?>

you can get your adminhtml router from etc/config.xml file

3

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.