I am a newbee to yii and i am middle of something.
I have many forms in view page where i click on submit it check the fields and enter database.

But my question is if i have 5 different forms that need to check for validation and should stay in the same form which is entering another form.In the view page i kept active for li which it is redirects to the page which is active form. How should i stop redirecting to active page if the fields are empty and should stay in that particular page and check for validation. 

IN the controller i have kept like this 

```
if(isset($_POST['myform'])) 
{ 
    $valid = true; 
    foreach($_POST as $p) 
    { 
        if($p == null) 
        { 
            $valid = false; 
        } 
    } 
    if($valid)
    { 
        $model->save(); 
        $this->render('mypage',array('model'=>$model,'model1'=>$model1,'model2'=>$model2‌​,'model3'=>$model3,'model4'=>$model4)); 
    }
} 

```