Hi
I have a created a form. I have a field called Type with options A or B. I want to have my form so that it you select option A the rest of the form will appear and the Email Recepient field will show the email address that its to submit to and if you select option B then the rest of the form appear and the Email Recepient field will show a different email adress for option B and the form will then submit to the option B address. Im not sure how to go about getting this to work or if its feasable.
My code is below:
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Proforma </title>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<script language="javas cript">
function XXX_JScheckForm ( f )
{
var sErrors = "";
var sfocusElements;
var aCheckFields = new Array();
aCheckFields[0] = "txt02_Name_of_ Caller:::Name of Caller";
aCheckFields[1] = "txt03_Type_of_ Caller:::Type of Caller";
aCheckFields[2] = "txt04_Tel_No:: :Tel No";
aCheckFields[3] = "txt10_Comments :::Comments";
// aCheckFields[4] = "txtMailingRefN umber:::Mailing Reference Number";
// aCheckFields[1] = "txtID:::Operat or ID";
// aCheckFields[6] = "txtDateTime::: Date/Time";
// Loop through each field identified as mandatory
for ( var i = 0; i < aCheckFields.le ngth; i++ )
{
var aData = aCheckFields[i].split( /\:\:\:/ );
var oFormElement = eval( "f." + aData[0] );
if ( oFormElement.va lue.match( /^\s*$/ ) )
{
sErrors += aData[1] + "\n";
if ( ! sfocusElements ) { sfocusElements = aData[0]; }
}
}
if ( sErrors )
{
alert( "The following fields are required - \n\n" + sErrors );
eval( "f." + sfocusElements + ".focus()" );
return false;
}
return true;
}
</script>
<FORM name="frmSendMa il" action="http://xxxxxxxxxxxxx/misc/sendmail/" method="POST" onsubmit="retur n XXX_JScheckForm ( this )">
<input type="hidden" name="ctrlSendT oEmailAddress" value="Email@Em ail=>Proforma"/>
<input type="hidden" name="ctrlEmail Subject" value="Proforma " />
<input type="hidden" name="ctrlMetho d" value="E-MAIL" />
<input type="hidden" name="ctrlFromE mailAddress" value=""/>
<input type="hidden" name="ctrlRedir ectURL" value="xxxxxxxx " />
<table width="90%" border="0" cellspacing="0" cellpadding="0" bgcolor="8ED1E6 ">
<tr>
<td valign="top" align="left">
<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="8ED1E6 " align="center">
<tr valign="top" align="left">
<td class="tableBac kLightestBlue" colspan="2" height="27">
<p class="pageHead "><b>Profor ma</b></p>
<p style="color: #CC0000">Fields marked with * are mandatory</p>
</td>
</tr>
<!-- start of form details -->
<TR>
<TD class="tableBac kLgtBlue2">EMAI L TYPE</td>
<td class="tableBac kLgtBlue2">
REQUEST
</td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">NAME OF CALLER</td>
<td class="tableBac kLgtBlue2" style="color: #CC0000"><input type="text" name="txt01_Nam e_of_Caller"> *</td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">TYPE OF CALLER</td>
<td class="tableBac kLgtBlue2" style="color: #CC0000"><input type="text" name="txt02_Typ e_of_Caller"> *</td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">COMP ANY POSTCODE</td>
<td class="tableBac kLgtBlue2"><inp ut type="text" name="txt03_Com pany_Postcode"> </td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">TELE PHONE NUMBER</td>
<td class="tableBac kLgtBlue2" style="color: #CC0000"><input type="text" name="txt04_Tel _No"> *</td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">POLI CY NUMBER</td>
<td class="tableBac kLgtBlue2"><inp ut type="text" name="txt05__Po licy_No"></td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">TYPE </td>
<td class="tableBac kLgtBlue2"><sel ect size="1" name="sel06_Typ e_of_Illustrati on">
<option value="Select"> Select</option>
<option value="A">A</option>
<option value="B">B</option>
</select>
</td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">MEMB ERS NAME</td>
<td class="tableBac kLgtBlue2"><inp ut type="text" name="txt07_Mem bers_Name"></td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">SEX</td>
<td class="tableBac kLgtBlue2"><inp ut type="text" name="txt08_Sex "></td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">DATE OF BIRTH</td>
<td class="tableBac kLgtBlue2"><inp ut type="text" name="txt09_DOB "></td>
</tr>
<tr>
<td class="tableBac kLgtBlue2">COMM ENTS</td>
<td class="tableBac kLgtBlue2" style="color: #CC0000"><texta rea name="txt10_Com ments" cols="30" rows="4"></textarea> *</td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">TURN AROUND TIMES</td>
<td class="tableBac kLgtBlue2">Text will go here
</td>
</tr>
<TR>
<TD class="tableBac kLgtBlue2">EMAI L RECIPIENT</td>
<td class="tableBac kLgtBlue2"><p>E mail@email</p></td>
</tr>
<tr valign="top" align="left">
<td class="tableBac kLgtBlue2" colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="19">
<tr valign="top" align="left">
<td width="20%">&nb sp;</td>
<td align="center"> </td>
<td align="right" width="20%">
<INPUT TYPE="submit" class="xxxButto n" value="SEND MAIL" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br><br>
</FORM>
</body>
</html>[/HTML]