I am trying to pass javascript variable to Controller action by calling "CreateURL" function,
JS Code:
Yii::app()->clientScript->registerScript('searchaevg', "
$('#newAddval_btn').click(function(){
var r = document.getElementById('cid').value;
window.location = '". yii::app()->createUrl('baseContact/add_refvalue',array("id" => ("#r"))). "'; });
");
Above code is not calling controller action, it throws
error "Error 400
Your request is invalid."