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!

Setting a as part of a value

Status
Not open for further replies.

Argonto

Technical User
Mar 17, 2011
23
US
So I am creating a form to sell next years list of shows to Season ticket holders.

Part of that form requires E-mail confirmation however our control; over the email content is limited, it only takes text and values stated in the form.
In order to avoid listing all the shows on the email, i created a java script if else statement to provide a null value for shows that were not purchased, however the line breaks are still present.

So i assigned <br /> to part of the value, however this sets off the "Server Error in '/' Application".
Code:
Server Error in '/' Application.

A potentially dangerous Request.Form value was detected from the client (Tix_Requested_Capitol_Steps_PriceB="<br />Tickets Reques...").

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Is there a way to include a new line into the value field, without it being seen as a error?

Java scrip
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 = "<br />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 = "<br /> Tickets Requested Capitol Steps Price C:    "; 
what.total_Capitol_Steps_PriceC.value = " ,   Total Capitol Steps Price C      $"; 
}

}

  </SCRIPT>



Email Coding
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>

 
Could you show the code that makes up the Order Summary? The break should be in there: not in the values.
 
The "Email coding" section is where i call the values for the order summary. Other than that the only java code is in the actual form. I've listed that below.
The trouble is that the way we send confirmation emails is limited to calling values and basic text. If the called value is Null it doesn't appear in the email.

Thanks for any and all assistance.

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 = "<br />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 = "<br /> 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>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top