Validation form builder


I’m trying to validate a form, first client-side using ajax.

I’ve been looking at the tutorial and the code looks like this:

DbTable is called: tbl_clutter with 3 fields, ClutterId,Author,Comment

Does however not seem to work, anyone spot any faults in the code?

(_form.php a partial view of create.php)

<div class='form'>


	// Modellen är passad till denna vy redan via create.php

	// Påbörjar form widget, tilldelar $form CActiveForm	

	$form = $this->beginWidget('CActiveForm', array(



        'clientOptions' => array(







    	// Author kod, label, fält, felhantering

    	echo $form->labelEx($model,'Author');

	    echo $form->textField($model,'Author',array('size'=>30,'maxlength'=>30));

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


	    echo "<br/>";


	    // Comment kod, label, fält , felhantering

	    echo $form->labelEx($model,'Comment');

	    echo $form->textArea($model,'Comment',array('size'=>500,'maxlength'=>500));

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



		echo "<br/>" . CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');




	public function actionCreate()


    	$model=new Clutter;




			echo CActiveForm::validate(array($model));




	        'model'=>$model, // Model is passed to create.php View!



Right now the validation i get back is only server-sided.

If i press "submit/create" on my form it will go to the server and then display that the fields require content.

How do i get this to work on the client?