How to display the string content of this array all at once using javascript?
<p>I am using this for form validation. I call this function when there is an error and i send it a string as a parameter. </p>

<pre><code>var errList = new Array();
    function aerrorList(error){
        errList.push(error);
        for (var i=0; i &lt; errList.length; i++){
            alert(errList[i]);
        }
    }
</code></pre>

<p>here is one of the validation checks:</p>

<pre><code>function lNameValidate() {
        var lName = document.getElementById("lastname");
        if (lName.value.length &lt; 20 &amp;&amp; /^[a-zA-Z0-9- ]*$/.test(lName.value)){
            stNumValidate();
        } else {
            lName.style.border = "red";
            errorList("Invalid lName Format");
            stNumValidate();
        }
    }
</code></pre>

<p>The current array (using alert) displays the error in a number of popup boxes with only 1 error string each. i want it to display 1 alert which would show all the errors in a list similar to outputting it in a bullet point way.</p>