Here is an example how to handle grid (like area grid) in IFRAME.
Add these 2 rows where form is loaded to get handle of the iframe
var iframe = document.getElementById('IFRAME_test');
iframe.onreadystatechange = FrameStateChanged;
function to handle iframe state changed like initalize, complete
function FrameStateChanged()
{
var iframe = document.getElementById('IFRAME_test');
if(iframe.readyState == "complete"){
// get grid from iframe
caseGrid = iframe.contentWindow.document.getElementById('crmGrid');
if (caseGrid != null)
caseGrid.attachEvent("onselectionchange",HandleGridSelectionChange);
}
}
// get guid from selected row.. can get all values.
function HandleGridSelectionChange()
{
//select row
var selectedRow = caseGrid.InnerGrid.SelectedRecords;
// get selected guid
if (selectedRow.length > 0)
var guid =selectedRow[0][0];
}
Enjoy,
Rami Heleg