Viewing complex.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--chtml include "//webinfo/incs/header.inc"-->

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
	<title>Mailto Complex Demo</title>
	<link href="/webinfo/webinfo.css" type="text/css" rel="stylesheet" />
	<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_validateForm() { //v3.0
  var i,p,q,nm,test,num,min,max,errors='',nerrs=0,plural,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(args[i+1])nm=args[i+1];if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
	if (p<1 || p==(val.length-1)) {++nerrs;errors+='- '+nm+' must contain an e-mail address.\n';}
      } else if (test!='R') { num = parseFloat(val);
	if (val!=''+num) {++nerrs;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 (num<min || max<num) {++nerrs;errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';}
    } } } else if (test.charAt(0) == 'R') {++nerrs;errors += '- '+nm+' is required.\n'; }}
  } if (errors) {if(nerrs==1)plural='error';else plural=nerrs+' errors';alert('The following '+plural+' occurred:\n'+errors);}
  document.MM_returnValue = (errors == '');
}
//-->
</script>
    </head>

    <body>
	<h1>Mailto Complex Demo</h1>
	<!--chtml include "//webinfo/incs/navbar.inc"-->
	<p>This is a sample mailto form. Note that it is not
	intended as a true request form, but only shows what
	can be done with mailto. You will not receive a reply
	to mail generated by this form.</p>
	<p>Note this demo form also does some rudimentary
	Javascript form verification to make sure that the
	email and Name fields are filled in. The verification
	code is generated by Macromedia Dreamweaver, but has
	been modified to be more descriptive when it generates
	an error.</p>
	<form action="complex.mailto" method="post">
	    <table border="1" cellspacing="2" cellpadding="0">
		<tr>
		    <td>Topic:</td>
		    <td><select name="subjectadd">
			    <option selected="selected">General Question</option>
			    <option>Want to Help</option>
			    <option>Car Washing</option>
			</select></td>
		</tr>
		<tr>
		    <td>E-mail Address:</td>
		    <td><input type="text" name="sender" value="" size="35" /></td>
		</tr>
		<tr>
		    <td>Name:</td>
		    <td><input type="text" name="sendername" value="" size="35" /></td>
		</tr>
		<tr>
		    <td>Department:</td>
		    <td><input type="text" name="department" value="" size="35" /></td>
		</tr>
		<tr>
		    <td>Phone Number:</td>
		    <td><input type="text" name="phone" value="" size="35" /></td>
		</tr>
		<tr>
		    <td>Box Number:</td>
		    <td><input type="text" name="mailstop" size="35" /></td>
		</tr>
		<tr>
		    <td>Comments:</td>
		    <td><textarea name="optcomments" rows="15" cols="55"></textarea></td>
		</tr>
	    </table>
	    Yes, please put me on your mailing list! <input type="checkbox" name="maillist" value="yes" /><br />
	    I would like to receive the mailings by <select name="media">
		<option selected="selected">E-Mail</option>
		<option>Departmental Mail</option>
		<option>FAX</option>
		<option>Automated voice mail</option>
	    </select>
	    <p><input onclick="MM_validateForm('sender','E-Mail Address','RisEmail','sendername','Name','R');return document.MM_returnValue" type="submit" value="Send Comment" />
	    <input type="reset" value="Clear Comment" />
	    <input type="hidden" name="comments" value="xxx" /></p>
	</form>
	<!--chtml include "//webinfo/incs/footer.inc"-->
    </body>

</html>