I am having a difficult time figuring this out. I would like to CC a recipient using the mailto function. The recipient would be a manually entered in a text box.
<SCRIPT LANGUAGE="JavaScript">
function IsEmailValid(form1,email)
{
var EmailOk = true
var Temp = document.form1.email
var AtSym = Temp.value.indexOf('@')
var Period = Temp.value.lastIndexOf('.')
var Space = Temp.value.indexOf(' ')
var Length = Temp.value.length - 1 // Array is from 0 to length-1
if ((AtSym < 1) || // '@' cannot be in first position
(Period <= AtSym+1) || // Must be atleast one valid char btwn '@' and '.'
(Period == Length ) || // Must be atleast one valid char after '.'
(Space != -1)) // No empty spaces permitted
{
EmailOk = false
alert('Please enter a valid e-mail address!')
Temp.focus()
}
return EmailOk
alert("Thank your filling out the form.");
return true;
}
</script>
</head>
<body>
<body>
<form method="POST" name="form1" ACTION="mailto:test@comcast.net;document.form1.email.value?cc=test1@comcast.com&subject=LOCAL FORM"
enctype= "text/plain" onSubmit="return IsEmailValid(form1,email);">
<TABLE>
<tr>
<td align="left">EMAIL</td>
<td width="23%"><input type=text name=email size=25 maxlength=50><font size="2" color="#ff0000">*</font></td>
<td width="12%" align="right"> </td>
<td width="12%" align="left"><font size="2">EMAIL2</font>
<td width="23%"><input type=text name=memail size=25 maxlength=50><font size="2" color="#ff0000">*</font></td> </tr>
<tr>
<td colspan="5" align="center" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top-width: 1px; border-bottom: 1px solid #000000" bgcolor="#E5E5E5">
<p>
<br>
<input type=submit value="Submit Form" onclick=></td>
</tr>
</TABLE>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
function IsEmailValid(form1,email)
{
var EmailOk = true
var Temp = document.form1.email
var AtSym = Temp.value.indexOf('@')
var Period = Temp.value.lastIndexOf('.')
var Space = Temp.value.indexOf(' ')
var Length = Temp.value.length - 1 // Array is from 0 to length-1
if ((AtSym < 1) || // '@' cannot be in first position
(Period <= AtSym+1) || // Must be atleast one valid char btwn '@' and '.'
(Period == Length ) || // Must be atleast one valid char after '.'
(Space != -1)) // No empty spaces permitted
{
EmailOk = false
alert('Please enter a valid e-mail address!')
Temp.focus()
}
return EmailOk
alert("Thank your filling out the form.");
return true;
}
</script>
</head>
<body>
<body>
<form method="POST" name="form1" ACTION="mailto:test@comcast.net;document.form1.email.value?cc=test1@comcast.com&subject=LOCAL FORM"
enctype= "text/plain" onSubmit="return IsEmailValid(form1,email);">
<TABLE>
<tr>
<td align="left">EMAIL</td>
<td width="23%"><input type=text name=email size=25 maxlength=50><font size="2" color="#ff0000">*</font></td>
<td width="12%" align="right"> </td>
<td width="12%" align="left"><font size="2">EMAIL2</font>
<td width="23%"><input type=text name=memail size=25 maxlength=50><font size="2" color="#ff0000">*</font></td> </tr>
<tr>
<td colspan="5" align="center" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top-width: 1px; border-bottom: 1px solid #000000" bgcolor="#E5E5E5">
<p>
<br>
<input type=submit value="Submit Form" onclick=></td>
</tr>
</TABLE>
</body>
</html>