Handling Variable Number Of Inputs

How to display the validation errors?

Right now the code just ignores models with validation errors.

		foreach($_POST['Task'] as $taskData)


		{


			$model = new Task();


			$model->setAttributes($taskData);


			if($model->validate())


				$models[] = $model;


		}

Just leave out the if ():




foreach($_POST['Task'] as $taskData)

{

    $model = new Task();

    $model->setAttributes($taskData);

    $model->validate();

    $models[] = $model;

} 



You are right, cool. Thanks.

How do I get the error message on the screen? ‘Title cannot be blank message’ ?