Hi I am new to asp and I am trying to figure out how to make a
order form. Everything seems to work fine exept when I use + to get
the total price.
Example: item1(price=10) + item2(price=10) = total: 20
instead of 20 I get total: 2020
When I use - then everything is working right
Here is the script that is not working:
<% = (strsamtals + strsamtals2) %>
<% =(strvsk + strvsk2) %>
Here is the code:
<%
Dim strnafn, strkennitala, strheimili, strheimasimi, strgsmsimi, strvinnusimi, strfax, strvegna, strath, strofnategund, strhaed, strlengd, strstutastaerd, strstutastadsetning, strverd, strstk, strsamtals, strvsk, strofnategund2, strhaed2, strlengd2, strstutastaerd2, strstutastadsetning2, strverd2, strstk2, strsamtals2, strvsk2
strofnategund2 = Request.Form("ofnategund2")
strhaed2 = Request.Form("haed2")
strlengd2 = Request.Form("lengd2")
strstutastaerd2 = Request.Form("stutastaerd2")
strstutastadsetning2 = Request.Form("stutastadsetning2")
strverd2 = Request.Form("verd2")
strstk2 = Request.Form("stk2")
strsamtals2 = Request.Form("samtals2")
strvsk2 = Request.Form("vsk2")
Response.Cookies("runtyl")("ofnategund2") = strofnategund2
Response.Cookies("runtyl")("haed2") = strhaed2
Response.Cookies("runtyl")("lengd2") = strlengd2
Response.Cookies("runtyl")("stutastaerd2") = strstutastaerd2
Response.Cookies("runtyl")("stutastadsetning2") = strstutastadsetning2
Response.Cookies("runtyl")("verd2") = strverd2
Response.Cookies("runtyl")("stk2") = strstk2
Response.Cookies("runtyl")("samtals2") = strsamtals2
Response.Cookies("runtyl")("vsk2") = strvsk2
strnafn = Request.Cookies("runtyl") ("nafn")
strkennitala = Request.Cookies("runtyl")("kennitala")
strheimili = Request.Cookies("runtyl")("heimili")
strheimasimi = Request.Cookies("runtyl")("heimasimi")
strgsmsimi = Request.Cookies("runtyl")("gsmsimi")
strvinnusimi = Request.Cookies("runtyl")("vinnusimi")
strfax = Request.Cookies("runtyl")("fax")
strvegna = Request.Cookies("runtyl")("vegna")
strath = Request.Cookies("runtyl")("ath")
strofnategund = Request.Cookies("runtyl")("ofnategund")
strhaed = Request.Cookies("runtyl")("haed")
strlengd = Request.Cookies("runtyl")("lengd")
strstutastaerd = Request.Cookies("runtyl")("stutastaerd")
strstutastadsetning = Request.Cookies("runtyl")("stutastadsetning")
strverd = Request.Cookies("runtyl")("verd")
strstk = Request.Cookies("runtyl")("stk")
strsamtals = Request.Cookies("runtyl")("samtals")
strvsk = Request.Cookies("runtyl")("vsk")
strnafn2 = Request.Cookies("runtyl") ("nafn2")
strkennitala2 = Request.Cookies("runtyl")("kennitala2")
strheimili2 = Request.Cookies("runtyl")("heimili2")
strheimasimi2 = Request.Cookies("runtyl")("heimasimi2")
strgsmsimi2 = Request.Cookies("runtyl")("gsmsimi2")
strvinnusimi2 = Request.Cookies("runtyl")("vinnusimi2")
strfax2 = Request.Cookies("runtyl")("fax2")
strvegna2 = Request.Cookies("runtyl")("vegna2")
strath2 = Request.Cookies("runtyl")("ath2")
strofnategund2 = Request.Cookies("runtyl")("ofnategund2")
strhaed2 = Request.Cookies("runtyl")("haed2")
strlengd2 = Request.Cookies("runtyl")("lengd2")
strstutastaerd2 = Request.Cookies("runtyl")("stutastaerd2")
strstutastadsetning2 = Request.Cookies("runtyl")("stutastadsetning2")
strverd2 = Request.Cookies("runtyl")("verd2")
strstk2 = Request.Cookies("runtyl")("stk2")
strsamtals2 = Request.Cookies("runtyl")("samtals2")
strvsk2 = Request.Cookies("runtyl")("vsk2")
%>
<div id="Layer3" style="position:absolute; left:22px; top:55px; width:540; z-index:14">
<table border="1" cellpadding="4" cellspacing="2" bordercolor="#000000">
<form name="form1" method="post" action="panta_runtyl3.asp">
<tr>
<td align="left" valign="middle"><strong>Nafn:</strong>
</td>
<td colspan="6" align="left" valign="middle"> <% =(strnafn) %> </td>
</tr>
<tr>
<td align="left"><strong>Kennitala:</strong></td>
<td colspan="6" align="left"> <% =(strkennitala) %> </td>
</tr>
<tr>
<td align="left"><strong>Heimili:</strong></td>
<td colspan="6" align="left"> <% =(strheimili) %> </td>
</tr>
<tr>
<td align="left"><strong>Heimasími:</strong></td>
<td colspan="6" align="left"> <% =(strheimasimi) %> </td>
</tr>
<tr>
<td align="left"><strong>Gsmsími:</strong></td>
<td colspan="6" align="left"> <% =(strgsmsimi) %> </td>
</tr>
<tr>
<td align="left"><strong>Vinnusími:</strong></td>
<td colspan="6" align="left"> <% =(strvinnusimi) %> </td>
</tr>
<tr>
<td align="left"><strong>Fax:</strong></td>
<td colspan="6" align="left"> <% =(strfax) %> </td>
</tr>
<tr>
<td align="left"><strong>Vegna:</strong></td>
<td colspan="6" align="left"> <% =(strvegna) %> </td>
</tr>
<tr>
<td align="left"><strong>Ath:</strong></td>
<td colspan="6" align="left"> <% =(strath) %> </td>
</tr>
<tr>
<td colspan="7" bgcolor="#CCCCCC"><input name="imageField" type="image" src="../images/spacer.gif" width="100" height="10" border="0"></td>
</tr>
<tr>
<td width="104"><strong>Ofnategund</strong></td>
<td width="42"><strong>Hæð</strong></td>
<td width="56"><strong>Lengd</strong></td>
<td width="47"><strong>Stutastærð</strong></td>
<td width="48"><strong>Stutastaðsetning</strong></td>
<td width="22"><strong>Stk</strong></td>
<td width="53"><strong>Verð</strong></td>
</tr>
<tr>
<td> <% =(strofnategund) %> </td>
<td> <% =(strhaed) %> </td>
<td> <% =(strlengd) %> </td>
<td> <% =(strstutastaerd) %> </td>
<td> <% =(strstutastadsetning) %> </td>
<td> <% =(strstk) %> </td>
<td> <% =(strverd) %> </td>
</tr>
<tr>
<td>
<% =(strofnategund2) %>
</td>
<td>
<% =(strhaed2) %>
</td>
<td>
<% =(strlengd2) %>
</td>
<td>
<% =(strstutastaerd2) %>
</td>
<td>
<% =(strstutastadsetning2) %>
</td>
<td>
<% =(strstk2) %>
</td>
<td>
<% =(strverd2) %>
</td>
</tr>
<tr>
<td colspan="7" bgcolor="#CCCCCC"><input name="imageField2" type="image" src="../images/spacer.gif" width="100" height="10" border="0"></td>
</tr>
<tr>
<td colspan="5" align="right"><strong>Samtals kr.</strong></td>
<td colspan="2"> <% = (strsamtals + strsamtals2) %> </td>
</tr>
<tr>
<td colspan="5" align="right"><strong>Þar af Vsk.</strong></td>
<td colspan="2"> <% =(strvsk + strvsk2) %> </td>
</tr>
<tr>
<td colspan="7" align="left"><strong>
<input type="button" value="Prenta" onclick="window.print()" name="B2">
</strong> </td>
</tr>
</form>
</table>
<br>
</div>