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…
Best Answer
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 fromMage_Customer_Block_Form_Register
?Have a look at
getFormData
inapp/code/core/Mage/Customer/Block/Form/Register.php
to see how this is done there.