I have added a new page to front end, as you can see Adding new page to Front end, by fixing some issues, it is working now. but the issue I am facing now is in my from

    <div id="abc-category-search">
    <!--method="post" action="<?php //echo Mage::getUrl('helloworld/index/index') ?>"--> 
    <form id="abc-category-search-form" method="post" action="<?php echo Mage::getUrl('homesearch/index/index') ?>">
        <label for="search"><?php echo $this->__('Search by product SKU/Category') ?>:</label>
        <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('customer/session')->getFormKey(); ?>"/>
        <input id="abc-category-search-string" name="search" value="" />
        <input id="abc-category-search-cat" type="hidden" name="category" value="<?php echo $category; ?>" />
        <button id="abc-category-search-submit" type="submit" class="engine-btn" value="" >
            <?php echo $this->__('Search') ?>

<div id="ajax-loader" class="hide" style="">
    <p><?php echo $this->__('Searching please wait...'); ?></p>
    <img src="<?php echo $this->getSkinUrl('images/ajax_loader_green_64.gif'); ?>" />

<script type="text/javascript">
    jQuery(document).ready(function ($) {

        $("#abc-category-search-form input").keypress(function (e) {
            if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
                return false;
            } else {
                return true;
        // Attach a submit handler to the form
        $("#abc-category-search-form").submit(function (event) {
            // Stop form from submitting normally
            // Get some values from elements on the page:
            var $form = $(this),
                    term = $form.find("input[name='search']").val(),
                    cat = $form.find("input[name='category']").val(),
                    url = $form.attr("action");
            // Send the data using post
            var posting = $.post(url, {search: term, category: cat});
            // Put the results in a div
            posting.done(function (data) {
    jQuery(document).load(function ($) {
        $("div.hero-top-content h2").html("Some Text Here")

my action action="<?php echo Mage::getUrl('helloworld') gives me url to my new page, myweb.com/helloworld, but issue is that on clicking submit button on my form, it go to related controller and tried to load accurate view(my custom page),but url never changes,ideally it should be changed. if I use myweb.com/helloworld in search bar manually, it loads correct page, don't where I am doing some thing wrong my controller is



class Abc_Helloworld_IndexController extends Mage_Core_Controller_Front_Action {
    public function indexAction() {

And my config.xml looks like this.


        <?xml version="1.0"?>

  • you can use action="<?php echo Mage::getUrl('myweb/helloworld') Jun 27, 2016 at 5:43
  • @Rakesh please see my updated post, Jun 27, 2016 at 5:49
  • in which Action of Controller are you want to submit form?
    – Amit Bera
    Jun 27, 2016 at 5:51
  • @AmitBera please have look on update Jun 27, 2016 at 5:54
  • I have just one Action in my Controller Jun 27, 2016 at 5:54

2 Answers 2


it depend on what is your <frontName>modulename</frontName>

try that with complete url

method="post" action="<?php echo Mage::getUrl('helloworld/index/index') ?>" 

you are using event.preventDefault(); that are stop form from submitting.

  • this is not working Jun 27, 2016 at 6:13
  • which url it is taking too? Jun 27, 2016 at 6:14
  • I have update my post Jun 27, 2016 at 6:17
  • As you asked, currently it is on Home page myweb.com, after action it it should be changed to myweb.com/helloworld Jun 27, 2016 at 6:18
  • 1
    I am using event.preventDefault();, add some other data before submission, if I remove event.preventDefault() it work, now have to figure an other way to pass data....thanks Jun 27, 2016 at 6:28

Your module url work like


In your case route is helloworld

Controllername is IndexController so name is index

Action name of IndexController.php file where you need to send your form data we considering indexAction name is index

As per url


In your case url will be


  • this is not working Jun 27, 2016 at 6:13
  • 1
    Your url is <?php echo Mage::getUrl('helloworld/index/index') ?> Jun 27, 2016 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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