Bluemoon1227
09-10-2002, 02:18 AM
Hello,
I'm fairly new to Javascript and I've been trying to figure this out for a while. I've included the code below, but here's the issue i'm having: I've created a page with a form on it which includes a text area that the user should be able to send to my e-mail address. The problem is that when the user clicks on "send," their default e-mail application comes up, therefore making the text area totally unnecessary to get to this site you can just go to http://www.ithaca.edu/students/arojas1 and click on the "Contact Me" link in the navigation bar. Should I just turn this into a link? Is it possible to do this? Thank you so much for taking the time to help. Here's the code and below it will be the function that the form calls "MM_validateForm":
<form name="Contact" enctype="text/plain" method="post" action="mailto:arojas1@ithaca.edu">
<div align="center">
<p>
<textarea name="message" cols="50" onSubmit="MM_validateForm('message','','R');return document.MM_returnValue" rows="10" wrap="VIRTUAL"></textarea>
</p>
<p class="button">
<input type="submit" name="Submit" value="Send" class="button">
<input type="reset" name="Reset" value="Clear">
<input type="hidden" name="ToEmailAddress" value="arojas1@ithaca.edu">
</p>
</div>
</form>
Function "MM_validateForm":
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
I'm fairly new to Javascript and I've been trying to figure this out for a while. I've included the code below, but here's the issue i'm having: I've created a page with a form on it which includes a text area that the user should be able to send to my e-mail address. The problem is that when the user clicks on "send," their default e-mail application comes up, therefore making the text area totally unnecessary to get to this site you can just go to http://www.ithaca.edu/students/arojas1 and click on the "Contact Me" link in the navigation bar. Should I just turn this into a link? Is it possible to do this? Thank you so much for taking the time to help. Here's the code and below it will be the function that the form calls "MM_validateForm":
<form name="Contact" enctype="text/plain" method="post" action="mailto:arojas1@ithaca.edu">
<div align="center">
<p>
<textarea name="message" cols="50" onSubmit="MM_validateForm('message','','R');return document.MM_returnValue" rows="10" wrap="VIRTUAL"></textarea>
</p>
<p class="button">
<input type="submit" name="Submit" value="Send" class="button">
<input type="reset" name="Reset" value="Clear">
<input type="hidden" name="ToEmailAddress" value="arojas1@ithaca.edu">
</p>
</div>
</form>
Function "MM_validateForm":
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}