I'm having problems with a JavaScript function not firing and I can't figure out why not.
I'm opening a pop-up window which needs to pass some variables back to the opening window. I've used this code elsewhere with no problems and I've copied it and changed some of the details and now it doesn't work. It's probably going to turn out to be something so stupid but I just can't see it.
Pop-up window code:
function sendValue (employerseq,employercode,employername)
{
var selvaluea = employerseq.value;
var selvalueb = employercode.value;
var selvaluec = employername.value;
window.opener.myfunc(selvaluea,selvalueb,selvaluec);
window.close();
}
Using alerts I can see that the correct variables have been passed into the funcion and are being assigned correctly. It doesn't seem to want to trigger the function in the opener window myfunc.
Opening Window code:
function myfunc(employerseq,employercode,employername)
{
alert('in my function');
window.document.getElementById('employer_seq').value = employerseq.value;
window.document.getElementById('employer_code').value = employercode.value;
window.document.getElementById('employer_name').value = employername.value;
}
It doesn't even trigger the first alert instruction in the function.
Can anybody see what the problem is?