Ajax To Do The Multiple Save In One Page

I have 3 tables: User ,Skill and UserSkill, that means User could have many Skill. I would like to add multiple skills for one user by using only one page. In there, user could choose the skill in the dropdownlist then save. The page need to have ajax function that would refresh the dropdownlist to remove selected skill from the list. Then user continue to add another skill until the user has all the skill.

I dont know how to config the CHtml for the button, the form and the dropdownlist to enable the ajax in Yii. Also, after enable the ajax, how does it connect to php file in the Yii?

Your help would be appreciated :).

simple axample for define ajax for dropdown:




'CHtml::DropDownList("calendar".$data->value, $data->value, $data->weeklyScheduleAvailable(),  array(

                                        "disabled"=>!$data->showUserAccessState("'.$_GET['id'].'", $data->value),

                                        "ajax" => array(

                                                "type"=>"POST", 

                                                "url"=>"'.Yii::app()->createUrl("/userZone/addCalToAccess").'",

                                                "data" => array(

                                                        "calId"=>"js:this.value",

                                                        "userId"=>"'.$_GET["id"].'",

                                                ),

                                                "success" => "js:function(html){

                                                        $.fn.yiiGridView.update(\"user-grid\");

                                                }",

                                                "error"=>"function (xhr, ajaxOptions, thrownError){

                                                        alert(xhr.statusText);

                                                        alert(thrownError);

                                                }",

                                                

                                        ),

            ))',

In success you need to update your list for DropDownList, and your controller action should do all magic.

I will try it, thank a lot :)