Hello!
I got a little issue with a button i am using.
if(!isset($_POST['select_box_name']) && !Yii::app()->user->isGuest){
echo CHtml::beginForm();echo CHtml::dropDownList('select_box_name',
'',
CHtml::listData(Connections::model()->findAll(), 'id', 'Sidenavn'));
echo CHtml::submitButton('Select');
echo CHtml::endForm();
}
else if(isset($_POST['select_box_name'])){
$_SESSION['dbid'] = $_POST['select_box_name'];
echo CHtml::beginForm();
echo CHtml::dropDownList('select_box_name',
$_POST['select_box_name'],
CHtml::listData(Connections::model()->findAll(), 'id', 'Sidenavn'));
echo CHtml::submitButton('Select',array('submit' => array('site/test')));
echo CHtml::endForm();
}
When i click my button first time, nothing happens but when i click it the next time, it reacts as intended.
Anyone know why this is?
(i know the code is horrible formed, im just doing some prototyping so i dont really care about that atm)