I am trying to figure out how to refresh an iframe from a popup window.
I can do it when the popup is called from the main page (ADDing records), but I can't figure it out for a popup that is called from within the iframe (EDITing records).
In addition to residing within an iframe the button to call the EDIT popup is a Caspio Data Page and is built from javascript during page load. All pages reside on the same domain.
Please consider the following scenario. (I removed classes, titles, and other irrelevant items for simplicity)
Main Page:
<div id="vehicles">
<div class="frmHeader">
<h2>Vehicles</h2>
<a onclick="popupWindow('addVehicle.html')"></a><!-- ADD vehicle -->
<a onclick="ifrRefresh('ifrVehicle')"></a>
</div>
<iframe src="lic/vehicle.html" name="ifrVehicle" id="ifrVehicle"></iframe>
</div>
Iframe Content html file:
<div id="ifrContentVehicle" class="ifrContent killHeader">
<script src="/scripts/e1.js"></script>
<script>try{f_cbload("***","http:");}catch(v_e){;}</script>
</div>
Iframe Content after load:
<div id="ifrContentVehicle" class="ifrContent killHeader">
<form id="caspioform">
<div>
<table name="cbTable">
<tbody>
<tr>
<td>
<a onclick="popupWindow('editVehicle.html?VehicleID=*')"></a><!--EDITv-->
...
Add Vehicle:
<script>
window.onunload = refreshParent;
function refreshParent() {
window.opener.ifrVehicle.location.reload();
}
</script>
This works to refresh my iframe named ifrVehicle. However, I cannot get it to work with the Edit popup.
Any help will be greatly appreciated!