Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to add a new form page
 
Lithium
Jr. Member
 
Total Posts:  2
Joined:  2008-07-15
 

I need to add a new page to my Magento setup that contains a form where users can submit information in hopes of selling their products to me.

I need to know the best way to do this since I’m very new to this software and can’t seem to wrap my mind around the system yet. Do I need to create a block with the php for the form in it, or is there some way I can include php into a new page. Or am I missing something?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Agent Mo
Member
 
Avatar
Total Posts:  51
Joined:  2008-07-14
 

In Zend Framework you could use the Zend_Form class to create a new form.

An example:

$form = new Zend_Form(array(
            
'action'   => '/someAction/save'
            
'method'   => 'post'
            
'elements' => array( 
        
                
'user' => array('text', array( 
                    
'required' => true
                    
'label' => 'User' 
                
)),
                
                
'text' => array('textarea', array( 
                    
'required' => true
                    
'label' => 'Some text' 
                
)),
                
                
'id' => array('hidden', array(  
                    
'value'  => -1,
                )),
                
                
'submit' => array('submit', array( 
                    
'label' => 'Save' 
                
)) 
            ), 
        ));
$this->view->form $form;
In the “template” you could display the form with:

<?echo $this->form?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

This may or may not help: http://www.magentocommerce.com/extension/283/lazzymonks-quote-page

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top