Post Empty

regards

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

http://localhost/yii/basapp/index.php/assignment/create?Student_Number=

or

http://localhost/yii/basapp/index.php/assignment/create?Student_Number=3333-107102

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) {

["Assignment"]=>

array(7) {

["userID"]=>


string(0) ""


["studentID"]=>


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

Hi

There is a problem in your code





		<?php

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

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

						array(

						'prompt'=>'Select Behavior Group',

						'ajax' => array(

							'type'=>'POST', 

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

							'update'=>'#'.CHtml::activeId($model,'behavID'),

						))); 

										

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

		?>




I hope below code will help you to solve this issue





						'ajax' => array(

							'type'=>'POST', 

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

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

							'dataType'=>'json', 

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

							 'success'=>'function(data) { 

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


							'update'=>'#'.CHtml::activeId($model,'behavID'),

						))); 




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

Hi

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]'data'[/color][color=#666600]=&gt;[/color][color=#000000]array[/color][color=#666600]([/color][color=#008800]'CycleID'[/color][color=#666600]=&gt;[/color][color=#008800]'js:this.value'[/color][color=#666600]),[/color][color=#000000] 


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


                                                     }'[/color][color=#666600],[/color][color=#000000]


                                                    [/color][color=#008800]'update'[/color][color=#666600]=&gt;[/color][color=#008800]'#'[/color][color=#666600].[/color][color=#660066]CHtml[/color][color=#666600]::[/color][color=#000000]activeId[/color][color=#666600]([/color][color=#000000]&#036;model[/color][color=#666600],[/color][color=#008800]'behavID'[/color][color=#666600]),[/color][color=#000000]


                                            [/color][color=#666600])));[/color]

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()

Hi,

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…