Cactiveform Open New Window And Make Get Request With Id Appeneded

I’m trying to build a page where I can pick an engineer from a dropdown list.

Once selected I want to hit a GO button and have the browser open a new tab and make a HTTP request to a URL with the engineerid appended to the the URL - http://localhost/index.php?/foo/bar/workshop?engineerid=123

So far I have an CActiveForm - OK

I have my populated dropdown list - OK

I have the GO button open a new page on submission (‘target’=>’_blank’) - OK

I have the URL set exactly where I want - OK

The problem I have is appending the engineerid parameter to the end of the URL, so for all it does is append Engineer[id]=1, which is then getting URL encoded.

I’m guessing I’m hitting some Yii uniqueness on how CActiveForm is meant to behave, is there a better way?

                $form2 = $this->beginWidget('CActiveForm', 








                echo $form2->labelEx($engineer, 'View Workshop'); 

                echo $form2->dropDownList($engineer,'id', 

                        CHtml::listData(Engineer::model()->findAllByAttributes(array('enabled'=>1)), 'id', '')); 

                echo CHtml::submitButton('Go', array('submit'=>$engineer->id));



I should had kept it simple and used CHtml::beginForm instead.

                echo CHtml::beginForm('/index.php/foo/bar/workshops', 




                echo CHtml::label('View Workshops', 'view-workshops'); 

                echo CHtml::dropDownList('engineerid', 'id', CHtml::listData(Engineer::model()->findAllByAttributes(array('enabled'=>1)), 'id', '')); 

                echo CHtml::submitButton('Go');

                echo CHTMl::endForm();