I used cookies. I found this to be the only reliable way to do this. I use GrayBox for my dialog, so I have a function in the dialog box that looks like this:
function selectValue(id, name) { SetCookie("_someuniqueprefix_RetID", id); SetCookie("_someuniqueprefix_RetValue", name); parent.parent.GB_CURRENT.hide(); }
Then, on my calling page, I launch a dialog box that displays partial in a GrayBox:
$(function() { var selectUrl = '/_somecontroller/Select'; // attach a method to the chooseButton to go and get a list of // contact persons to select from $("#chooseButton").click(function() { GB_showCenter('Select My thing', selectUrl, 500, 620, function() { var id = GetCookie("_someuniqueprefix_RetID"); var value = GetCookie("_someuniqueprefix_RetValue"); DeleteCookie("_someuniqueprefix_RetID", "/", ""); DeleteCookie("_someuniqueprefix_RetValue", "/", ""); $("#MyID").val(id); $("#MyName").val(value); }); }); });
You will also need to grab a function from the Internet for SetCookie and GetCookie
Hope that helps
source share