我有一个CHTML:ajax
功能可以在选择下拉列表中执行一些 AJAX 操作 - 我只是想做一些说明..
“在更改时,获取选定的值并将其作为childID
URL 中的参数传递”
这应该会url
在
CHTML::ajax function:-
'url' => 'isAjax=1&childID=5134156'
我试图将选择的变量附加到 url 上,但它不起作用 - 任何人都可以看到我做错了什么
jQuery(function($) {
$('#child-form select[name="Child[user_id]"]').bind('change', function(e){
var selected = this.value;
console.log('selected : '+selected ); // outputs an ID to the console.
<?php echo CHtml::ajax(array(
'url' => '?isAjax=1&childID='+selected,
'type' => 'post',
'update' => '#parents-sidebar',
// rest of the ajax function (quite long...)