Can I use 2 fields for the same input?

I have the following situation:

I have Subject, Seminar, Participants and Pending.

I register participants in Seminars for a specific Subject.

If a Seminar is cancelled, the registered Participants go into Pending (so in the next Seminar of the same subject, the user will be notified about these pending Participants).

How can I display these pending participants in the registration form?

Seminar Model:

public function createPending(){



		foreach ($listParticipants as $lp){

			$pending=new Pending();






Registration _form:


	<div class="row">

		<?php echo $form->labelEx($model,'seminarID'); ?>

		<?php echo $form->textField($model,'seminarID',$model->getSeminar()); ?>

		<?php echo $form->error($model,'seminarID'); ?>


        And here is what I want: when a seminar is selected (which is of a specific subject)

I want to show here if there is any pending participant for the same subject...

and I want to select from this list and it should store that participant ID in the registration.

How can it work at the same time when there is also the below field for selecting participants?


        <div class="row">

		<?php echo $form->labelEx($model,'participantID'); ?>

		<?php echo $form->dropDownList($model,'participantID',$model->getParticipant()); ?>

		<?php echo $form->error($model,'cTeilnehmerID'); ?>


Maybe what you need are dependent dropDownLists

I am already using dependent dropDownLists, but doesn’t fit properly to this requirement.

I would like to know if it is possible to have lets say 2 dropDownLists, but both of them assigning the same attribute? And not to have conflict or so with each other? Is there any way to do this?


you take first drop down for seminars and by ajax send “seminar_id”, then in ajax action search in pending model where seminar_id = $_POST[‘seminar_id’]. and get participant in listData

Ok, here is the solution to my question (at least most of it, but still a problem):

Registration _form:

	<div class="row">

		<?php echo $form->labelEx($model,'seminarID'); ?>

		<?php echo $form->dropDownList($model, 'seminarID', $model->getSeminar(),




						'update'=>'#'.CHtml::activeID($model, 'participantID'),





		)); ?>

		<?php echo $form->error($model,'seminarID'); ?>



	<div class="row">

		<?php echo $form->labelEx($model,'participantID'); ?>

		<?php echo $form->dropDownList($model,'participantID',Pending::model()->getParticipant()); ?>

		<?php echo $form->error($model,'participantID'); ?>



	public function actionSelectPending(){


		$test=Seminar::model()->find('seminar = :test', array(':test'=>$seminar))->subjectID;


		$list=Pending::model()->findAll('subjectID = :sub', array(':sub'=>$test));

<img src='' class='bbc_emoticon' alt='???' />?<img src='' class='bbc_emoticon' alt='???' />?<img src='' class='bbc_emoticon' alt='???' />?<img src='' class='bbc_emoticon' alt='???' /> $list=CHtml::listData($list,'participantID','participantID');


		foreach ($list as $value=>$name){

			echo CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);



But I have a problem: In the line with "question marks" everything works fine.

But I want to show the name of participant. In this case there is a problem doing:


where ‘participant’ is the name of relation. In this case it will show the names of participants where their ID are as the pendingID and not paricipant ID!!!

I tried anonymous function inside listData(), but still same result…

Any idea how to solve this?

you are check out firebug and console tab.

see parameters passed.

My mistake…

In Pending I had relation:

'participant' => array(self::HAS_ONE, 'Participant', 'participantID'),

It should be:

'participant' => array(self::BELONGS_TO, 'Participant', 'participantID'),