view里面怎么写javascript [ 新手入门 ]
例子如下:
<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?
共 0 条回复
没有找到数据。
attajob Shanghai
注册时间:2011-12-09
最后登录:1970-01-01
在线时长:0小时0分
最后登录:1970-01-01
在线时长:0小时0分
- 粉丝0
- 金钱240
- 威望0
- 积分240