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

default value for a checkbox element
 
Elzo Valugi
Jr. Member
 
Total Posts:  28
Joined:  2010-02-01
 

I am trying to set the default values for a Varien_Data_Form

$defaultValues = array(
‘abc’ => ‘true’,
‘bbc’ => 1,
‘ddc’ => ‘checked’
);
$form->setValues( $defaultValues );

all three elements are checkboxes and none of the above versions works.
In ZF I think the Zend_Form_Element had a method setAttribute(’checked’, ‘checked’) but Varien Form Element seems not to inherit from Zend.

What is the correct way to check it in Magento?

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