At the end of each message, include a \n. This will put a newline character at the end, and start the next error on the next line.
Code:
<%
Dim ErrorMsg
ErrorMsg = "1) This is an error message\n\n"
ErrorMsg = ErrorMsg & "2) A second error message\n\n"
ErrorMsg = ErrorMsg & "3) A third error message"
%>
<script language="JavaScript">
<!--
alert(<%=ErrorMsg%>);
//-->
</script>
This will make an error box pop up with the message formatted like:
Code:
1) This is an error message
2) A second error message
3) A third error message
Or you could get fancy and make an html error popup. This way you can make nicely designed error pages.
Code:
<%
Dim ErrorMsg
ErrorMsg = "1,2,3"
%>
<script language="JavaScript">
<!--
window.open("errormsg.asp?ErrorMsgID=<%=ErrorMsg%>", "ErrorMsgWin", "height=300,width=300");
//-->
</script>
ErrorMsg.asp:
Code:
<html><body>
<%
Dim aErrorMsgs()
Dim aErrorArray
ReDim aErrorMsgs(3)
aErrorMsgs(0) = "This is message 1."
aErrorMsgs(1) = "This is message 2."
aErrorMsgs(2) = "This is message 3."
aErrorArray = Split(Trim(Request.QueryString("ErrorMsgID")), ",")
Dim x
For x = 0 To UBound(aErrorArray)
Response.Write aErrorMsgs(aErrorArray(x)) & "<BR>"
Next
%>
</body></html>