Menu

Help: Javascritp

Help
2008-06-16
2012-06-07
  • Brandon Shimek

    Brandon Shimek - 2008-06-16

    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

     
    • Brandon Shimek

      Brandon Shimek - 2008-06-16

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.