Passing Data To Cjuidialog

I am trying to pass a data variable into a text control of the dialogbox. I am using the data function of the dialog to pass the variable in via the onclick event. How do I get the variable back out to the textedit box of the dialog so it is displayed at startup??


   


echo CHtml::button('Edit Category', array('onclick'=>'{$("#dialogModifyCategory").data("category",$("#id_category").val()).dialog("open");}','class'=>'assetControl3'));

                                                

     $this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog

        'id'=>'dialogModifyCategory',

        'options'=>array(

            'title'=>'Modify Category',

            'autoOpen'=>false,

            'modal'=>true,

            'width'=>300,

            'height'=>200,

            'buttons'=>array('Submit'=>'js: function() {

                editdata = {edit_category: $("#edit_category").val(), id_category: $("#id_category").val()};

                $.ajax({

                    type:"POST",

                    url: "/TekEnterpriseServer/index.php?r=asset/modifycategory", 

                    data: editdata,

                    success: function() {}

                   });

                 

                $(this).dialog("close");

                }',

                'Cancel'=>'js: function() {$(this).dialog("close");}'),

            ),

        ));

    ?>

    

    <div class="form" id="modify_category"

     <?php

      echo "<a class='assetLabel2' style='left: 25px'>Edit Category</a>";

      echo '</br>';

      echo CHtml::textField('edit_category','', array('class'=>'assetEntry', 'style'=>'left: 25px'));

    ?>

    </div> 

    

    <?php  

    $this->endWidget('zii.widgets.jui.CJuiDialog');

    ?>