I'm getting an error on the page during runtime in my javascript: Object required, I can't fine it. Please see code:
view plaincopy to clipboardprint?
function SendTO(){
var toTxtBox = document.getElementById("btnTo");
var NameList; // error is on this line
var count = document.getElementById("lstNDisplay").length;
for(var i=0; i < count; i++){
NameList = document.getElementById("lstNDisplay").options.text;
toTxtBox.value = toTxtBox.value = NameList;
if((count > 1) && (i < count - 1)){
toTxtBox.value = toTxtBox.value + ';' ;
}
}
Cancel();
}
and the button that fires this code:
<input id="OkButton" type="button" value="Ok" onclick="SendTO()" />
function SendTO(){
var toTxtBox = document.getElementById("btnTo");
var NameList; // error is on this line
var count = document.getElementById("lstNDisplay").length;
for(var i=0; i < count; i++){
NameList = document.getElementById("lstNDisplay").options.text;
toTxtBox.value = toTxtBox.value = NameList;
if((count > 1) && (i < count - 1)){
toTxtBox.value = toTxtBox.value + ';' ;
}
}
Cancel();
}
and the button that fires this code:
<input id="OkButton" type="button" value="Ok" onclick="SendTO()" />
The error the runtime page:
Line: 142, char 17, error: Object required
view plaincopy to clipboardprint?
function SendTO(){
var toTxtBox = document.getElementById("btnTo");
var NameList; // error is on this line
var count = document.getElementById("lstNDisplay").length;
for(var i=0; i < count; i++){
NameList = document.getElementById("lstNDisplay").options.text;
toTxtBox.value = toTxtBox.value = NameList;
if((count > 1) && (i < count - 1)){
toTxtBox.value = toTxtBox.value + ';' ;
}
}
Cancel();
}
and the button that fires this code:
<input id="OkButton" type="button" value="Ok" onclick="SendTO()" />
function SendTO(){
var toTxtBox = document.getElementById("btnTo");
var NameList; // error is on this line
var count = document.getElementById("lstNDisplay").length;
for(var i=0; i < count; i++){
NameList = document.getElementById("lstNDisplay").options.text;
toTxtBox.value = toTxtBox.value = NameList;
if((count > 1) && (i < count - 1)){
toTxtBox.value = toTxtBox.value + ';' ;
}
}
Cancel();
}
and the button that fires this code:
<input id="OkButton" type="button" value="Ok" onclick="SendTO()" />
The error the runtime page:
Line: 142, char 17, error: Object required