Hi,
I need some help here.
I am developing something similar to the email system using php.
Currently, I am writing something for the users to select the check boxes in order to select the recipients of the email.
This is (like the Yahoo! email) basically a pop up menu, with all the email addresses drawn from the database and check boxes for the users to select.
And similar to the Yahoo! email system, after the users made their selections and click on the select button, the pop up table will close and the selected email addresses will be instantly reflected in the mail browser page, in the to: textbox.
something like this:
to: [email][email protected][email][email protected][email][email protected]
[COLOR=red]
I need a function to read all the checked boxes and place a “,” after each email address, which is achieved by the code below. But my challenge now is to omit the “,” for the last email address that is being selected
Can anyone advise please…
function updateaddr_bcc(listStr){
nAddr = document.getElementsByName(‘address’);
if (listStr!=”){
for (i=0; i<nAddr.length; i++)
{if (nAddr[i].checked == true){listStr += “,” + nAddr[i].value}}}
[COLOR=blue]
else{ // this is the part that requires changes
count=nAddr.length;
for (i=0; i<count; i++)
{if (nAddr[i].checked == true && ……){listStr += nAddr[i].value + “,”}
if (nAddr[i].checked == true && …….){listStr += nAddr[i].value }
}
}
opener.replyauthor.bcc_email.value = listStr;
self.close();
}
Can someone please advise on the approach to achieve this?
Any advise is most appreciated.
Thanks for reading.