My HTML markup contains a div with an id of "buttons".
Within the div is a button defined as:
<input type='button' id='seeHistory' value='See History'>
This button's event handler that looks like this:
case "See History":
document.getElementById("buttons").style.display = 'none'; //Remove buttons from display
makeNewWindow();
writeToWindow();
// Here is where I need to capture & process the select value made in this window
document.getElementById("buttons").style.display = 'block'; //Redisplay buttons
break;
The functions are here defined:
function makeNewWindow() {
// make sure it isn't already opened
if (!g_newWindow || g_newWindow.closed) {
g_newWindow = window.open("","seeHx","height=260,width=350,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,directories=0,status=0");
setTimeout("writeToWindow()", 50); // delay writing until window exists in IE/Windows
} // window is already open or focusable, so bring it to the front
g_newWindow.focus();
}
function writeToWindow() {
var newContent = "<html><head><title>History of Calls</title></head>";
newContent += "<body><em><h3>Select person called</h3></em><br />";
newContent += "<SELECT name='selectID'>";
for (x=0; x < g_array.length; x++) {
newContent += "<option value = '"+g_array[x][0]+"'> "+g_array[x][1]+" "+g_array[x][2]+" </option>";
}
newContent += "</SELECT><br /><br />";
newContent += "<INPUT TYPE='cancel' VALUE='Quit' onClick='self.close()' />";
newContent += " <INPUT TYPE='submit' VALUE='Submit' onClick='self.close()' />";
// HOW DO I GRAB THIS VALUE ON CLOSE of the SUBMIT ??
newContent += "</body></html>";
// write HTML to new window document
g_newWindow.document.write(newContent);
g_newWindow.document.close( ); // close layout stream
}
Within the div is a button defined as:
<input type='button' id='seeHistory' value='See History'>
This button's event handler that looks like this:
case "See History":
document.getElementById("buttons").style.display = 'none'; //Remove buttons from display
makeNewWindow();
writeToWindow();
// Here is where I need to capture & process the select value made in this window
document.getElementById("buttons").style.display = 'block'; //Redisplay buttons
break;
The functions are here defined:
function makeNewWindow() {
// make sure it isn't already opened
if (!g_newWindow || g_newWindow.closed) {
g_newWindow = window.open("","seeHx","height=260,width=350,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,directories=0,status=0");
setTimeout("writeToWindow()", 50); // delay writing until window exists in IE/Windows
} // window is already open or focusable, so bring it to the front
g_newWindow.focus();
}
function writeToWindow() {
var newContent = "<html><head><title>History of Calls</title></head>";
newContent += "<body><em><h3>Select person called</h3></em><br />";
newContent += "<SELECT name='selectID'>";
for (x=0; x < g_array.length; x++) {
newContent += "<option value = '"+g_array[x][0]+"'> "+g_array[x][1]+" "+g_array[x][2]+" </option>";
}
newContent += "</SELECT><br /><br />";
newContent += "<INPUT TYPE='cancel' VALUE='Quit' onClick='self.close()' />";
newContent += " <INPUT TYPE='submit' VALUE='Submit' onClick='self.close()' />";
// HOW DO I GRAB THIS VALUE ON CLOSE of the SUBMIT ??
newContent += "</body></html>";
// write HTML to new window document
g_newWindow.document.write(newContent);
g_newWindow.document.close( ); // close layout stream
}