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

select box “selected” in magento admin
 
check&learn
Member
 
Total Posts:  34
Joined:  2010-04-27
 

HI all

I am using a custom module and I need to add a select box in my module.I used following method for creating a select box.Now I need to select a particular value in the select box while I relaod the page.How can I do this?

What i am looking for is

<select>

<
option value=1>PHP</option>
<
option selected value=2>magento</option

</select>

What I am using now

for($i=2;$i<count($ids);$i++)
     
{
    $yesno[]

    array(
'value' => $ids[$i],'label' => $finals[$i]);
   
           
    
}

$fieldset->addField('categories''select', array(
          
'label'     => Mage::helper('vupload')->__('Select a Category'),
          
'name'      => 'categories',
          
'onchange'  => "test();",
          
'values'    => $yesno
      
));

please help me
Regards
atc

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