Hello,
I"m trying to send mail to multi users, but i doesn"t succeded/
I doesn"t know how to add all the mails that i selected to the mailto tag.
this the the code that I wrote:
<SCRIPT LANGUAGE="JavaScript">
function getSelected(opt) {
var selected = new Array();
var index = 0;
for (var intLoop = 0; intLoop < opt.length; intLoop++) {
if ((opt[intLoop].selected) ||
(opt[intLoop].checked)) {
index = selected.length;
selected[index] = new Object;
selected[index].value = opt[intLoop].value;
selected[index].index = intLoop;
}
}
return selected;
}
function outputSelected(opt) {
var sel = getSelected(opt);
var strSel = "";
for (var item in sel)
strSel += sel[item].value + "\n";
}
</SCRIPT>
</head>
<body>
<jsp:include page="header.jsp"/>
<% String str=null; %>
<h1>The members</h1>
<table width="100%" border="2" bordercolor="blue" class="tt">
<tr>
<td align="center" width="10%">select </td>
<td align="center" width="25%">City</td>
<td align="center" width="30%">Mail </td>
<td align="center" width="20%">User Name </td>
</tr>
</table>
<% for (user u: projDB.getUser().values()){ %>
<form method="post" >
<table width="100%" border="2" bordercolor="blue" class="tt">
<tr>
<td align="center" width="10%"><input type="checkbox" name="mail" value=<%= u.getMail()%>></td>
<td align="center" width="25%"> <%= u.getCity()%></td>
<td align="center" width="30%"> <%= u.getMail()%></td>
<td align="center" width="20%"> <%= u.getUserName()%></td>
</tr>
</table>
<%str+=u.getMail()+",";%>
<br><br>
<%} %>
<input type="button" value="send" onclick="outputSelected(this.form.mail)" >
</form>
please help me how can i solve this.
thank u