Sign up ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I had created the dropdown list in magento admin.But i am not getting how to save the dropdown list.I have added the dropdown list in below files.Please any one can Help me.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Try this. i see issue in your select box name it should be "bloodgroup" as per your code in controller for save

$fieldset->addField("Bloodgroup", "select", array(
                "label"     => Mage::helper("serviceprovider")->__("Bloodgroup"),
                "name"      => "bloodgroup", 
                "values"    => array(
                  '-1'=> array( 'label' => 'Please Select....', 'value' => '-1'),
                  '1' => array(
                           'value'=> array(array('value'=>'2' , 'label' => 'A') , array('value'=>'3' , 'label' =>'AB'), array('value'=>'4' , 'label' => 'AB+') , array('value'=>'5' , 'label' =>'AB-'), array('value'=>'6' , 'label' => 'A+') , array('value'=>'7' , 'label' =>'B+') , array('value'=>'8' , 'label' => 'O+ ') , array('value'=>'9' , 'label' =>'O-')),

                         ), 
                ), 
                ));
share|improve this answer
    "values"    => array(
                   array( 'label' => 'Please Select....', 'value' => '-1'),

                 array('value'=>'2' , 'label' => 'A') ,

     array('value'=>'3' , 'label' =>'AB'),
 array('value'=>'4' , 'label' => 'AB+') ,
 array('value'=>'5' , 'label' =>'AB-'),
 array('value'=>'6' , 'label' => 'A+') ,
 array('value'=>'7' , 'label' =>'B+') , array('value'=>'8' , 'label' => 'O+ ') ,
 array('value'=>'9' , 'label' =>'O-'),

                         ),

or you can add it like that too

'values' => array('-1'=>'Please Select....',2=>'A',3=>'AB',4=>'AB+'),
share|improve this answer
    
If you see my form I have added in the same way but when i am saving the dropdown list it is not saving. – Mouni 14 hours ago
    
no they are not same you add values on main array replace it and then check.. – Qaisar Satti 14 hours ago
    
Once can you check in save action in service Controller.php file. – Mouni 14 hours ago
    
i checked your save action there is no problem there the problem was in the form that i fixed – Qaisar Satti 14 hours ago
    
Changed the form as you said but it not saving. – Mouni 14 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.