views:

4303

answers:

1

Can anyone provide a dummy guide \ code snippets on how to create a front end form in Magento that posts data to a controller action.

Im trying to write a variant of the contact us from. (I know its easy to modify the contact us form, as outlined here). I'm trying to also create a feedback form with additional fields.

Given this basic form:

<form action="<?php echo $this->getFormAction(); ?>" id="feedbackForm" method="post">   
                <div class="input-box">
                    <label for="name"><?php echo Mage::helper('contacts')->__('Name') ?> <span class="required">*</span></label><br />
                    <input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserName()) ?>" class="required-entry input-text" type="text" />
                </div>

    <div class="button-set">
        <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
        <button class="form-button" type="submit"><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></button>
    </div>
</form>

What are the basic step I need to take to get inputted name to a controller action for processing?

+4  A: 

If any one is interested, I solved this by building my own module which was heavily based on the Magneto contact us module.

Here are some link that help me figure things out.

http://www.exploremagento.com/magento/simple-custom-module.php

http://www.magentocommerce.com/wiki/custom_module_with_custom_database_table

http://t.wits.sg/2009/03/31/howto-repackageable-custom-extension-development-in-magento-part-2-admin-controller/

http://inchoo.net/ecommerce/magento/magento-custom-emails/

Dan