I've got it. I might have taken 5 years off of my life but this one is fixed. I ended up killing the dynamic assignment because it was messing up and being really verbose. I wrote a fn like this:
-
function selVal(field, val){
-
field.value = val;
-
return false;
-
}
-
then changed the previous fn I posted to work as follows:
-
for (var i=0;i<arr.length;i++)
-
{
-
var a = _bsn.DOM.createElement("div", { bgColor:"white" });
-
a.innerHTML = "<a href=\"#\" onclick=\"selVal(document.getElementById('"+pointer.fld.id+"'),"+arr[i]+");\">"+arr[i]+"</a>";
-
//javascript: selVal(document.getElementById('"+pointer.fld.id+"'),"+arr[i]+");" }, arr[i]);
-
//a.onclick = function () { pointer.setValue( this.childNodes[0].nodeValue ); return false; };
-
//a.onclick = eval(function (){ selVal(document.getElementById(pointer.fld.id),arr[i]);});
-
//a.onclick = function(){ alert('got it'); };
-
//alert(a.onclick);
-
var li = _bsn.DOM.createElement( "li", {}, a );
-
ul.appendChild( li );
-
}
-
As you can see from the comments there was a whole lot of trial and error but basically I used innerHTML (I know it isn't standard but it is well supported) to write out a link with the proper onclick event rather than assigning dynamically. I don't know why dynamic assignment of the event wouldn't work but at this point I'm cutting my losses and running.