attajob 2012-02-10 11:20:52 3530次浏览 0条回复 0 0 0

例子如下:

<div class="row">
<?php echo $form->labelEx($model,'machine_sn'); ?>
<?php 
//echo $form->textField($model,'sn',array('size'=>10,'maxlength'=>10));
echo $form->dropDownList($model,'machine_sn',$model->getMachineSnList(),array(
'empty'=>'Please',
'ajax'=>array(                                               'url'=>Yii::app()->createUrl('issue/dynamicMachine'), // A string containing the URL to which the request is sent
//'data'=>array('pid'=>'js:this.value'),// Data to be sent to Server                                     'data'=>array('pid'=>'js:document.getElementById("Issue_machine_sn").value'),
//'update'=>'#Issue_project_number, #Issue_machine_installation, #Issue_machine_installation_responsible ', // string, specifies the selector whose HTML content should be replaced by the AJAX request result
'success'=>'updateFields',
'datatype'=>'json'
),
));
?>
                                    
<?php echo $form->error($model,'machine_sn'); ?>
</div>
<script type='text/javascript'>
    function updateFields(data)
    { alert ('abcdefg');
    $('#Issue_project_number).html(data.value1);
    $('#Issue_machine_installation).html(data.value2)
    }    
</script>

我怎么写这个updateFields?

    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册