I have an email form which contains the javascript (for user to pick email address) and I downloaded the perl script (CGI_LIB_PL.pl) for decoding the user input for the textarea. I know the CGI_LIB_PL.pl is a standard perl lib which will perform the decoding.
Additional Note:
1. What the /cgi-bin/CGI_LIB_PL.pl does is to convert the input from HTML format into whatever readable (If we do not use this perl script, it can't read some special char. example: all spaces become +'s)
Problem: See the document below. When I use the email form to send out email, it just returned a CGI timeout page for me.
Question:
1. Am I using the right way to call the CGI_LIB_PL.pl?
2. Do I have to use an additional perl script to tell the CGI_LIB_PL.pl what to do? If so, how?
Please see the following
===============================================================
function doMail()
{
// Reset each variable each time button is clicked
address="";
checked1=false;
checked2=false;
checked3=false;
checked4=false;
// Next 4 if's check to see which addresses are checked
if (document.email.email1.checked==1)
{
address+=document.email.email1.value;
checked1=true;
}
if (document.email.email2.checked==1)
{
if(checked1==true)
{
address+=",";
}
address+=document.email.email2.value;
checked2=true;
}
if (document.email.email3.checked==1)
{
if(checked1==true || checked2==true)
{
address+=",";
}
address+=document.email.email3.value;
checked3=true;
}
if (document.email.email4.checked==1)
{
if(checked1==true || checked2==true || checked3==true)
{
address+=",";
}
address+=document.email.email4.value;
checked4=true;
}
// Alert message if no address is checked
if(checked1==false&&checked2==false&&checked3==false&&checked4==false)
alert("\nYou must select an address from the list first.");
else
document.mesgForm.action="mailto:"+address+""
}
</script>
<form name="email">
<p><input type="checkbox" name="email1" value="cathy@aol.com">Cathy<br>
<input type="checkbox" name="email2" value="123456@skytel.com">Email Pager<br>
<input type="checkbox" name="email3" value="john@aol.com">John<br>
<input type="checkbox" name="email4" value="KK@sfsu.edu">KK</p>
<p> </p>
</form>
<form method="post" action="/cgi-bin/CGI_LIB_PL.pl" name="mesgForm" onsubmit="doMail()">
<p><textarea name="message" rows="5" cols="30"></textarea><br>
<br>
<input type="reset" value="Reset Form"> <input type="submit" value="Send Message"> </p>
</form>
</body>
</html>