before using javascript, declare the tag like this :
<select size=\"8\" name=\"listbox[]\" style=\"width: 418; height: 152\" multiple>
the important thing is the \"listbox[]\" otherwise, php will just receive a single item only.
You also must enable multiple in order to select all during submit.
for me, i use a form OnSubmit event.
<form name=\"forms\" action=\"submit.php\" onsubmit=\"return selectall()\">
so, on your javascript, declare a function call selectall() like this :
function selectall();
{
for (var i=0;i < document.forms[\"AnswerList[]\"].length;i++)
document.forms[\"AnswerList[]\"].options.selected = true;
return true;
);
when u submit, javascript will call and select all the items inside the listbox.
when php receive, you will get all the items in the $listbox array.
when u do a loop count($listbox), u will get the total items of what u\'ve selected during submit.