hexeliebe
10-23-2007, 01:11 PM
I am getting old and can't remember how to do this.
var xy = this.getAttribute('assocSpan') //result is txtmsg1
var spanTxt = "The contents of this field are too long!";
var dc=document.getElementById( xy );
dc.innerHTML=spanTxt;
It just doesn't work and reports a "NULL" value for xy although when I place an alert just above the third line, the result is correct.
I need to remember how to generate the getElementById() dynamically because I have associated spans for each form element.
var xy = this.getAttribute('assocSpan') //result is txtmsg1
var spanTxt = "The contents of this field are too long!";
var dc=document.getElementById( xy );
dc.innerHTML=spanTxt;
It just doesn't work and reports a "NULL" value for xy although when I place an alert just above the third line, the result is correct.
I need to remember how to generate the getElementById() dynamically because I have associated spans for each form element.