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.srcEl ement.href1.sub string(0,(event .srcElement.hre f1.length-1));
var Field=event.src Element.href2.s ubstring(1,(eve nt.srcElement.h ref2.length-1));
var tablePop='';
tablePop+='<TAB LE oncontextmenu=\ "return false\";>';
tablePop+='<SCR IPT LANGUAGE="JavaS cript">\n';
tablePop+='\n<!--\n';
tablePop+='wind ow.onerror=null ;\n';
tablePop+='/-->\n';
tablePop+='<\/SCRIPT>\n';
tablePop+='<TR> <TD ONCLICK="render Data(Val,Field) ;"> Fil ter op
'[***] + Field + ' is ' + Val +'</TD></TR>';
tablePop+='<TR> <TD> Filte r op ' + Field + ' is NIET '+
Val +'</TD></TR>';
tablePop+='<\/TABLE>';
var oPopupBody = oPopup.document .body;
oPopupBody.inne rHTML = tablePop;
oPopup.show(x, y, 140, 220, document.body);
}
function renderData(filt erValue,filterF ield)
{
alert(filterVal ue);
alert(filterFie ld);
}
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.srcEl ement.href1.sub string(0,(event .srcElement.hre f1.length-1));
var Field=event.src Element.href2.s ubstring(1,(eve nt.srcElement.h ref2.length-1));
var tablePop='';
tablePop+='<TAB LE oncontextmenu=\ "return false\";>';
tablePop+='<SCR IPT LANGUAGE="JavaS cript">\n';
tablePop+='\n<!--\n';
tablePop+='wind ow.onerror=null ;\n';
tablePop+='/-->\n';
tablePop+='<\/SCRIPT>\n';
tablePop+='<TR> <TD ONCLICK="render Data(Val,Field) ;"> Fil ter op
'[***] + Field + ' is ' + Val +'</TD></TR>';
tablePop+='<TR> <TD> Filte r op ' + Field + ' is NIET '+
Val +'</TD></TR>';
tablePop+='<\/TABLE>';
var oPopupBody = oPopup.document .body;
oPopupBody.inne rHTML = tablePop;
oPopup.show(x, y, 140, 220, document.body);
}
function renderData(filt erValue,filterF ield)
{
alert(filterVal ue);
alert(filterFie ld);
}
Comment