feoalter7,
и что не так?
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body> <input name="test" type="checkbox" value="12345" checked="checked">
<script>
var control = {
res_array: ['hmmm!'],
count_checked_elem: function(name){
var res_array_temp = new Array(), self = this;
var Elements = document.getElementsByName(name), countChecked = 0, coincidence = 0;
for(var i = 0, count = Elements.length; i < count; i++){
if(Elements[i].checked){
var currentElemVal = Elements[i].value;
res_array_temp.push(currentElemVal);
countChecked++;
}
}
self.res_array = res_array_temp;
alert(self.res_array); //выводит верный, сформированный массив
return countChecked;
},
submit: function(){
var self = this;
alert(self.res_array); //выводит тотже массив
}
}
control.submit();
control.count_checked_elem('test');
control.submit();
</script>
</body>
</html>