S
Sharon
Hi! Does anyone know why the onclick in the following popup menu gives
the error:"Val is undefined"? Does it have something to do with the
fact that it is called within the variable tablePop? Because it IS
displayed properly as part of the popup text, where it is called
outside the single quotation marks (see [***]). It is only in the
onclick that it's causing problems. Who can help me?
function dopopup(x,y) {
var Val=event.srcElement.href1.substring(0,(event.srcElement.href1.length-1));
var Field=event.srcElement.href2.substring(1,(event.srcElement.href2.length-1));
var tablePop='';
tablePop+='<TABLE oncontextmenu=\"return false\";>';
tablePop+='<SCRIPT LANGUAGE="JavaScript">\n';
tablePop+='\n<!--\n';
tablePop+='window.onerror=null;\n';
tablePop+='/-->\n';
tablePop+='<\/SCRIPT>\n';
tablePop+='<TR><TD ONCLICK="renderData(Val,Field);"> Filter op
'[***] + Field + ' is ' + Val +'</TD></TR>';
tablePop+='<TR><TD> Filter op ' + Field + ' is NIET '+
Val +'</TD></TR>';
tablePop+='<\/TABLE>';
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = tablePop;
oPopup.show(x, y, 140, 220, document.body);
}
function renderData(filterValue,filterField)
{
alert(filterValue);
alert(filterField);
}
the error:"Val is undefined"? Does it have something to do with the
fact that it is called within the variable tablePop? Because it IS
displayed properly as part of the popup text, where it is called
outside the single quotation marks (see [***]). It is only in the
onclick that it's causing problems. Who can help me?
function dopopup(x,y) {
var Val=event.srcElement.href1.substring(0,(event.srcElement.href1.length-1));
var Field=event.srcElement.href2.substring(1,(event.srcElement.href2.length-1));
var tablePop='';
tablePop+='<TABLE oncontextmenu=\"return false\";>';
tablePop+='<SCRIPT LANGUAGE="JavaScript">\n';
tablePop+='\n<!--\n';
tablePop+='window.onerror=null;\n';
tablePop+='/-->\n';
tablePop+='<\/SCRIPT>\n';
tablePop+='<TR><TD ONCLICK="renderData(Val,Field);"> Filter op
'[***] + Field + ' is ' + Val +'</TD></TR>';
tablePop+='<TR><TD> Filter op ' + Field + ' is NIET '+
Val +'</TD></TR>';
tablePop+='<\/TABLE>';
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = tablePop;
oPopup.show(x, y, 140, 220, document.body);
}
function renderData(filterValue,filterField)
{
alert(filterValue);
alert(filterField);
}