This event runs in Internet Explorer, but not in MS Edge/Chrome. I edited some minor errors in the code, hopefully it clears up some confusion. Thanks for the links on tools to help, however, I am not allowed to download/use such tools unless they are approved by security...
Form 'C' Button event calls function in a Det.js file, which performs
calculations for the deduction and then fills in the input box next to it.
function CalcF2A() {
F2Awin = window.open("F2A.asp", "F2A", "width=500,height=450,top=300,left=200");
}
Which runs code in the F2A.asp file, aka popup, after close popup
button is clicked.
function F2Acont() {
// child is calling the parent...
try {
window.opener.CalcF2Acont();
}
catch (err) {
alert(err.description || err)
TypeError:
Cannot read properties of
undefined(reading 'FatherIncomeTotalGross')
}
}
//End -->;
//Back to the parent file Det.js file:
function CalcF2Acont() {
// doesn't make it here after exception is displayed.
alert("CalcF2Acont() cALLED?")
F2Awin.close(); //popup doesn't close.
// fetch the amount in the input, could this be the exception?
var MS = document.fidCSW.FatherIncomeTotalGross.value;
}
//form name='fnCSW' id='fidCSW'
Is it trying to read the value of the input?
Is the code correct for the textbox, something missing?
"
< input readonly
class="father blankIfMedianNetUsed blankIfParentFcOrNnr"
type='text'
name='FatherIncomeTotalGross'
value= '<%= fatherIncomeTotalGross %>';
>
"
What I have tried:
UPdated May 24.
I am out of my league here, If anyone can help, it would be great!! I am fixing bugs on IE to Edge/Chrome bugs and it's been twenty years since I looked at a javascript.
This is a legacy ASP vbScript/javasript website that has some issues running in MS Edge/Chrome. I was able to add try/catch to find the bug, I still don't know why it is happening in Edge. This is a good example of really bad coding, which may or may not be the issue. I have tried using alert() try/catch around different lines and it appears not to work after the exception. Thank for the links, after reading I did test this in MS Edge IE mode and it does work correctly. Still will not work for Chrome.