0

I need to create vendor registration from for our vendor. How to create Form helper in custom form

<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
<ul>
<li class="fields">

                </li>
                <li>
                    <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
                    <div class="input-box">
                        <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
                    </div>
                </li>
</ul>
</form>

I m getting error Fatal error: Call to a member function getEmail() on a non-object I need to know how can i crete form object in magento...

2

The problem in your case is, that the function $this->getFormData() does not return an object to work with where you can get the e-mail from. Does your block class derive from Mage_Customer_Block_Form_Register?

Have a look at getFormData in app/code/core/Mage/Customer/Block/Form/Register.php to see how this is done there.

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.