Could someone explain to me how exactly the javascript in this program works? I am curious about how this code work
function MailSelection() {
var addresses = ""; var dst_count = 0;
for (i = 0; i < document.getElementsByName("selected[]").length; i++) { if( document.getElementsByName("selected[]")[i].checked == true) { if( document.getElementsByName("selected[]")[i].accept != "") { addresses = addresses + document.getElementsByName("selected[]")[i].accept; dst_count++; } } }
if(dst_count == 0) alert("No address selected."); else location.href = "mailto:addresses; } </script>
Thank you.
-Brandon
I think I got it. I missed a line of code in index.php Thank you to anyone you has helped me in the past and for your time.
Log in to post a comment.
Could someone explain to me how exactly the javascript in this program works? I am curious about how this code work
function MailSelection()
{
var addresses = "";
var dst_count = 0;
for (i = 0; i < document.getElementsByName("selected[]").length; i++)
{
if( document.getElementsByName("selected[]")[i].checked == true)
{
if( document.getElementsByName("selected[]")[i].accept != "")
{
addresses = addresses + document.getElementsByName("selected[]")[i].accept;
dst_count++;
}
}
}
if(dst_count == 0)
alert("No address selected.");
else
location.href = "mailto:addresses;
}
</script>
Thank you.
-Brandon
I think I got it. I missed a line of code in index.php
Thank you to anyone you has helped me in the past and for your time.
-Brandon