A client has implemented a feature on their webpage that detects changes made in a grid of data and prompts the user to save before leaving. If users feel confused or encounter multiple errors, they can simply cancel their changes and start over.
They have incorporated these pages into a login system using iframes. The plan is to introduce a new submenu within the login system for easy navigation through the pages displayed in iframes, replacing the original on-page navigation.
The grids on these pages set flags to indicate when data in a cell has been modified. The page navigation seamlessly checks these flags and alerts users about unsaved data in any of the grids.
The question now arises - how will the parent page's menu identify whether flags have been set by the child pages' grids? Currently, these flags are stored in an array where the index corresponds to the grid number.
Most cells perform this action or call another function which then triggers this process:
--------------------------------------------------------
. . . onchange='make_input_changed(grid_NM)' . . .
-------------------------------------------------------
// example with up to 6 grids on page
var input_changed = new Array('false', 'false', 'false', 'false', 'false', 'false');
// set a flag for each grid indicating changed data
function make_input_changed(grid_NM) { input_changed[grid_NM] = true; }
-----------------------------------------------------
Is it possible for the parent to access these flags from the child?
Can the child trigger a parent function to monitor changes?