For PHP, we must use test[] for the select name, but it doesn't work in javascript. document.form1.test is null.
So we should use document.getElementById('test[]') or document.form1['test[]']. On this way, we are able to get multiple select value in both PHP and JavaScript.