Need assistance with a code snippet that creates dynamic textboxes and their onchange event. The event fires successfully but does not return any value. Any suggestions on how to troubleshoot this issue would be greatly appreciated.
txt_box.Attributes.Add("onchange", "loadValues('" + txt_box.ClientID + "')");
function loadValues(controlName) {
alert(controlName);
// Control name is displayed in the alert message
var txtValue = document.getElementById(controlName);
// However, control returns null
if (txtValue.value.length > 0)
{
alert(txtValue.value.length);
}
}