Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an email order summary from a form.

Status
Not open for further replies.

Argonto

Technical User
Mar 17, 2011
23
US
I am setting up a form to sell Broadway and ovation performances. The problem i am having is with the Email confirmation. I need to list only the shows that customers have selected in a clear and concise way, however our cms has a very simple email response field. It can only handle text and values.

I have setup a set of code that checks if a show is selected and if so assigns it a value, if not it remains null. This allows me to only show the selected events, however the email will contain multiple empty lines. So i need to find a way to put the selected show together.

I have tried setting a <br /> as a value, which doesn't work as my cms sees it as an attack and blocks it.
Some other thoughts have been to sort the values either by setting up a third value set and assigning selected shows to it, or by "printing" each selected show to a value but i'm not really sure where to start with each of those ideas.

Any thoughts or assistance on this would be greatly appreciated.

This is the code i have been working/ testing with.
Code:
<SCRIPT language=javascript type=text/javascript>

function set_pricetag(rad_obj)
{
var PriceA=document.getElementById('value1');
var PriceB=document.getElementById('value2');
var PriceC=document.getElementById('value3');
var date=document.getElementById('value4');

var unmform_values=rad_obj.value.split(',');

PriceA.value=unmform_values[0];
PriceB.value=unmform_values[1];
PriceC.value=unmform_values[2];
date.value=unmform_values[3];
}


function calculate(what)
{
  what.unmform_Total_Price_all.value = 

 (    (what.unmform_Total_Capitol_Steps_PriceA.value - 0)
  + (what.unmform_Total_Capitol_Steps_PriceB.value - 0)
  + (what.unmform_Total_Capitol_Steps_PriceC.value - 0)).toFixed(2);

if (what.unmform_Tix_Requested_Capitol_Steps_PriceA.value == 0) 
{ 
what.Tix_Requested_Capitol_Steps_PriceA.value = null; 
what.total_Capitol_Steps_PriceA.value = null; 
}
else
{ 
what.Tix_Requested_Capitol_Steps_PriceA.value = "Tickets Requested Capitol Steps Price A:    "; 
what.total_Capitol_Steps_PriceA.value = " ,   Total Capitol Steps Price A      $"; 
}
if (what.unmform_Tix_Requested_Capitol_Steps_PriceB.value == 0) 
{ 
what.Tix_Requested_Capitol_Steps_PriceB.value = null; 
what.total_Capitol_Steps_PriceB.value = null; 
}
else
{ 
what.Tix_Requested_Capitol_Steps_PriceB.value = "</ n>Tickets Requested Capitol Steps Price B:    "; 
what.total_Capitol_Steps_PriceB.value = " ,   Total Capitol Steps Price B      $"; 
}

if (what.unmform_Tix_Requested_Capitol_Steps_PriceC.value == 0) 
{ 
what.Tix_Requested_Capitol_Steps_PriceC.value = null; 
what.total_Capitol_Steps_PriceC.value = null; 
}
else
{ 
what.Tix_Requested_Capitol_Steps_PriceC.value = "</ n> Tickets Requested Capitol Steps Price C:    "; 
what.total_Capitol_Steps_PriceC.value = " ,   Total Capitol Steps Price C      $"; 
}

}

  </SCRIPT>

<TABLE class=SMALL cellSpacing=0 cellPadding=0 width=700 frame=box align=center>
<TBODY>
<TR vAlign=center align=middle>
<TD style="BACKGROUND-COLOR: #1f497d" class=style2 vAlign=center borderColor=#000000 width=270 align=middle>
<DIV align=center><STRONG><FONT color=#ffffff>Ovation Series</FONT></STRONG></DIV></TD>
<TD style="BACKGROUND-COLOR: #f1f1f1; WIDTH: 137px" bgColor=#90a5bf borderColor=#000000 width=180>
<DIV align=center><STRONG><FONT color=#000000>Number of Tickets Requested</FONT></STRONG></DIV></TD>
<TD style="BACKGROUND-COLOR: #f1f1f1; WIDTH: 100px" bgColor=#90a5bf borderColor=#000000 width=100>
<DIV align=center><STRONG><FONT color=#000000>Ticket Price</FONT></STRONG></DIV></TD>
<TD style="BACKGROUND-COLOR: #f1f1f1; WIDTH: 100px" bgColor=#90a5bf borderColor=#000000 width=200>
<DIV align=center><STRONG><FONT color=#000000>Total</FONT></STRONG></DIV></TD></TR>
<TR>
<TD vAlign=center width=270 align=middle>
<DIV align=center></DIV></TD>
<TD vAlign=top width=180 align=middle><INPUT type=hidden name=unmform_LineBreak6> </TD>
<TD vAlign=top width=100 align=middle>&nbsp;</TD>
<TD vAlign=top width=200 align=middle>&nbsp;</TD></TR>
<TR>
<TD style="BACKGROUND-COLOR: #1f497d" class=style2 vAlign=center width=270 align=middle>
<DIV align=center><STRONG><FONT color=#ffffff>Capitol Steps</FONT></STRONG></DIV></TD>
<TD bgColor=#90a5bf vAlign=center width=180 align=middle>
<DIV align=center><SPAN class=style36>&nbsp;11/14/12&nbsp;</SPAN></DIV></TD>
<TD bgColor=#90a5bf vAlign=center width=100 align=middle>
<DIV align=center><SPAN class=style37></SPAN></DIV></TD>
<TD bgColor=#90a5bf vAlign=center width=200 align=middle>
<DIV align=center><SPAN class=style36>Sunday, 3:00pm</SPAN></DIV></TD></TR>
<TR>
<TD style="WIDTH: 55px" vAlign=center width=270 align=middle>
<DIV align=center><INPUT border=0 value="Price A" readOnly align=middle size=10 name=Capitol_Steps_PriceA> </DIV></TD>
<TD style="WIDTH: 137px" vAlign=top width=180 align=middle><INPUT onkeyup="this.form.unmform_Total_Capitol_Steps_PriceA.value = ((this.form.unmform_Tix_Requested_Capitol_Steps_PriceA.value - 0) * (34.00 - 0)).toFixed(2)  ;calculate(this.form)" border=0 size=10 name=unmform_Tix_Requested_Capitol_Steps_PriceA> </TD>
<TD style="WIDTH: 100px" vAlign=top width=100 align=middle>$34.00</TD>
<TD style="WIDTH: 100px" vAlign=top width=200 align=middle><INPUT border=0 readOnly size=10 name=unmform_Total_Capitol_Steps_PriceA></TD></TR>
<TR>
<TD style="WIDTH: 55px" vAlign=center width=270 align=middle>
<DIV align=center><INPUT border=0 value="Price B" readOnly align=middle size=10 name=Capitol_Steps_PriceB> </DIV></TD>
<TD style="WIDTH: 137px" vAlign=top width=180 align=middle><INPUT onkeyup="this.form.unmform_Total_Capitol_Steps_PriceB.value = ((this.form.unmform_Tix_Requested_Capitol_Steps_PriceB.value - 0) * (24.00 - 0)).toFixed(2)  ;calculate(this.form)" border=0 size=10 name=unmform_Tix_Requested_Capitol_Steps_PriceB></TD>
<TD style="WIDTH: 100px" vAlign=top width=100 align=middle>$24.00</TD>
<TD style="WIDTH: 100px" vAlign=top width=200 align=middle><INPUT border=0 readOnly size=10 name=unmform_Total_Capitol_Steps_PriceB></TD></TR>
<TR>
<TD style="WIDTH: 55px" vAlign=center width=270 align=middle>
<DIV align=center><INPUT border=0 value="Price C" readOnly align=middle size=10 name=Capitol_Steps_PriceC> </DIV></TD>
<TD style="WIDTH: 137px" vAlign=top width=180 align=middle><INPUT onkeyup="this.form.unmform_Total_Capitol_Steps_PriceC.value = ((this.form.unmform_Tix_Requested_Capitol_Steps_PriceC.value - 0) * (10.00 - 0)).toFixed(2)  ;calculate(this.form)" border=0 size=10 name=unmform_Tix_Requested_Capitol_Steps_PriceC></TD>
<TD style="WIDTH: 100px" vAlign=top width=100 align=middle>$10.00</TD>
<TD style="WIDTH: 100px" vAlign=top width=200 align=middle><INPUT border=0 readOnly size=10 name=unmform_Total_Capitol_Steps_PriceC><INPUT type=hidden name=unmform_LineBreak_1><INPUT type=hidden name=unmform_Capitol_Steps></TD></TR>
<TR>
<TD vAlign=center width=270 align=middle>
<DIV align=center><FONT color=#000000 face=Georgia></FONT></DIV></TD>
<TD width=180><FONT color=#000000 face=Georgia>&nbsp;</FONT></TD>
<TD width=100><FONT color=#000000 face=Georgia>&nbsp;</FONT></TD>
<TD vAlign=top width=200 align=middle><FONT color=#000000 face=Georgia>&nbsp;</FONT></TD></TR></TBODY></TABLE>
<TABLE width=700 align=center>
<TBODY>
<TR>
<TD><FONT color=#000000 face=Georgia>&nbsp;</FONT></TD>
<TD><FONT color=#000000 face=Georgia>Grand Total </FONT></TD>
<TD style="WIDTH: 100px" vAlign=top align=middle><INPUT onclick=email(this.form) border=0 readOnly size=10 name=unmform_Total_Price_all><FONT color=#000000 face=Georgia> </FONT>
<TD><FONT color=#000000 face=Georgia></FONT></TD>
<TR>
<TD></TD>
<TD><INPUT border=0 readOnly size=30 name=total_Capitol_Steps_PriceA> </TD>
<TD><INPUT border=0 readOnly size=30 name=total_Capitol_Steps_PriceB></TD>
<TD><INPUT border=0 readOnly size=30 name=total_Capitol_Steps_PriceC></TD></TR>
<TR>
<TD></TD>
<TD><INPUT border=0 readOnly size=30 name=Tix_Requested_Capitol_Steps_PriceA> </TD>
<TD><INPUT border=0 readOnly size=30 name=Tix_Requested_Capitol_Steps_PriceB></TD>
<TD><INPUT border=0 readOnly size=30 name=Tix_Requested_Capitol_Steps_PriceC></TD></TR></TBODY></TABLE>


This is the code that the Email uses.
Code:
Dear <ctl00$Content_MainContent$textbox_FirstName> <ctl00$Content_MainContent$textbox_LastName>,

Thank you for your purchase of Ovation Tickets.
Your Order totaling <unmform_Total_Price_all> has been received
and will be processed shortly.

Your tickets will be mailed at a later date.


Order Summary
Your order is as follows,
<Tix_Requested_Capitol_Steps_PriceA>	<unmform_Tix_Requested_Capitol_Steps_PriceA> <total_Capitol_Steps_PriceA><unmform_Total_Capitol_Steps_PriceA><Tix_Requested_Capitol_Steps_PriceB>	<unmform_Tix_Requested_Capitol_Steps_PriceB> <total_Capitol_Steps_PriceB><unmform_Total_Capitol_Steps_PriceB><Tix_Requested_Capitol_Steps_PriceC>	<unmform_Tix_Requested_Capitol_Steps_PriceC> <total_Capitol_Steps_PriceC><unmform_Total_Capitol_Steps_PriceC>
	
Grand Total:	<unmform_Total_Price_all>

Thanks again! :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top