在客户注册表单中,默认情况下每行只有一个输入字段。
class Namespace_Modulename_Block_Adminhtml_Edit_Tab_Customer
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('customform_form',
array('legend' => Mage::helper('customform')->__('Account information')));
$fieldset->addField('associate_to_website', 'select', array(
'label' => Mage::helper('customform')->__('Associate to Website'),
'class' => 'required-entry validate-select',
'required' => true,
'options' => array(0=>"Main Website", 1=>"Store Website"),
'name' => 'associate_to_website'
));
$fieldset->addField('firstname', 'text', array(
'label' => Mage::helper('customform')->__('First Name'),
'class' => 'required-entry validate-alphanum',
'required' => true,
'name' => 'firstname'
));
$fieldset->addField('lastname', 'text', array(
'label' => Mage::helper('customform')->__('Last Name'),
'class' => 'required-entry validate-alphanum',
'required' => true,
'name' => 'lastname'
));
$fieldset->addField('gender', 'select', array(
'label' => Mage::helper('customform')->__('Gender'),
'class' => 'required-entry validate-select',
'required' => false,
'options' => array(0=>"Male",1=>"Female"),
'name' => 'gender'
));
$fieldset->addField('email', 'text', array(
'label' => Mage::helper('customform')->__('Email'),
'class' => 'required-entry validate-email',
'required' => true,
'name' => 'email'
));
$fieldset->addField('dateofbirth', 'date', array(
'label' => Mage::helper('customform')->__('Date Of Birth'),
'class' => 'required-entry validate-daterange',
'required' => false,
'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
'image' => $this->getSkinUrl('images/grid-cal.gif'),
'name' => 'dateofbirth'
));
$fieldset->addField('taxnumber', 'text', array(
'label' => Mage::helper('customform')->__('Tax Number'),
'class' => 'required-entry validate-alphanum',
'required' => false,
'name' => 'taxnumber'
));
$fieldset->addField('vatnumber', 'text', array(
'label' => Mage::helper('customform')->__('VAT Number'),
'class' => 'required-entry validate-alphanum'
'required' => false,
'name' => 'vatnumber'
));
return parent::_prepareForm();
}
}
在Magento 1.9 adminportal的客户注册表中,默认情况下每行只有一个字段。根据类似论坛网站的一些参考资料,我尝试了很多方法将两个输入字段放在一行中。但是我无法做到。所以,如果有人正在阅读这篇博客,请在'如何在magento adminportal中每行输入两个输入字段?建议我一些答案。谢谢提前.. ....