Post Value Of Dropdownlist Always Empty

Hi,

Like described in the title, i’ trying to use a dropdownlist for post back page.

The post is receive in the controller but the value selected is empty.

Here is my dropdownlist


<?php echo CHtml::dropDownList('groupe',$groupe, 

  array("A"=>"A","B"=>"B","C"=>"C","D"=>"D","E"=>"E","F"=>"F","G"=>"G","H"=>"H"),

  array(

    'prompt'=>'--Choisir un groupe--',

    'submit'=>CController::createUrl('classement'),

  //'data'=>array('groupe'=>'js:this.value'),

  ));  ?>

Here is my controller


public function actionClassement($groupe="")

	{echo $groupe;

                if(isset($_POST['groupe'])){echo $_POST['groupe']."ici=".$groupe;

                    $groupe = $_POST['groupe'];

                }echo 'test';

                $model = Team::model()->getClassementByGroupe($groupe);

                $games = array();

                $games = Game::model()->getGameByGroupe($groupe);

                //echo '<pre>test';echo print_r($model);echo '</pre>';

		$this->render('classement',array(

			'model'=>$model,

                        'groupe'=>$groupe,

                        'games'=>$games,

		));

	}

Thanks for your help

I’m not sure if you are getting $groupe passed in, but things I would try:

Instead of


echo $_POST['groupe']."ici=".$groupe;

try


print_r($_POST['groupe']);

You may also have the form and dropdown having the same name that you might have to use:


$x = $_POST['groupe']['groupe'];