I am trying to redirect to another view following a test on a value in a form.
I am using jquery to test the value in the form. The URL is being called and the action run in the controller but the current view is not redirected to the other view.
Thank you very much Outrage. You set me on the right track, wondering why I did not think about that
Here is the amended javascript code:
<?php Yii::app()->getClientScript()->registerScript('tabl','$("#tabl").change(function()
{ $.get("index.php?r=order1/Tabl", {tabl:$("#tabl").val()}, function(data)
{
var orderid = data;
if (orderid!=0)
{ alert("An open order exists for this table. You will be redirected to this existing order");
window.location.replace("index.php?r=order1/update&id=" + orderid);
}
});
}
);');
?>