Post Empty


i have a view page which can i access it via 2 ways [links]




in my view, if i didn’t pass the student number to the link, a form opens with a list of students (selected base on a selected cycle and a selected class) that i have to select one of them, then i select a behavior, behavior group and finally the behavior

every thing here goes fine

if i pass the student number, no need to select the cycle and the class to select the student, so i got the student info via its number which i already have it

the same code is written for the two cases, just a little difference concerning the how to display the data not more [as you can see in the attached files]

the problem is when i select the behavior group in order then to get the behavior list related to the select group, the list appears empty

without student number, the firebug message before selecting the behavior:

array(4) {


array(7) {


string(0) ""


string(11) "3333-100101"

without student number:

<h1>PHP Error [8]</h1>

<p>Undefined index: Assignment (C:\xampp\htdocs\yii\basapp\protected\controllers\AssignmentController.php:624)</p>

<pre>#0 C:\xampp\htdocs\yii\basapp\protected\controllers\AssignmentController.php(624): CWebApplication->handleError()

var_dump($_POST) i got this result:

array(0) {


can anyone tell me the problem where is?

thanks in advance


There is a problem in your code


			echo $form->dropDownList($model,'behavGroupID', CHtml::listData(Behaviorgroup::model()->findAll(), 'ID', 'E_BGName'),

			//echo $form->dropDownList($model,'behavGroupID', array(),


						'prompt'=>'Select Behavior Group',

						'ajax' => array(


							'url'=>CController::createUrl('Assignment/getBehavior'), //url to call.




				echo $form->error($model,'behavGroupID');


I hope below code will help you to solve this issue

						'ajax' => array(


							'url'=>CController::createUrl('Assignment/getBehavior'), //url to call.

// This portion is missing in your code.. so its not sending any data back to controller.



							 'success'=>'function(data) { 

[size=2]							[/size][size=2] }',[/size]



thank you

i put your code but i got this error

Parse error: syntax error, unexpected ‘/’, expecting ‘]’ in C:\xampp\htdocs\yii\basapp\protected\views\assignment\_formcreate.php on line 287

what is the size parameter

and why the code is working fine if student_Number parameter is empty and if not, it gives me an error?

what is size?

and why the passsing of the variable for the jque


Just remove the size related thing … its look like tag included with this text editor

[color=#008800] ‘dataType’[/color][color=#666600]=>[/color][color=#008800]‘json’[/color][color=#666600],[/color][color=#000000]


                                                     [/color][color=#008800]'success'[/color][color=#666600]=&gt;[/color][color=#008800]'function(data) { 




i got the same error

<h1>PHP Error [8]</h1>

<p>Undefined index: Assignment (C:\xampp\htdocs\yii\basapp\protected\controllers\AssignmentController.php:648)</p>

<pre>#0 C:\xampp\htdocs\yii\basapp\protected\controllers\AssignmentController.php(648): CWebApplication->handleError()


Error says… you are using different name for passing _GET attribute and getting different attribute. you have to change that code according to your variable name… how should i know your varialbe names :(

Please copy the method from controller. Here its old code … i could not find the perfect code line…