elieazzi
asked on
Addition fields in JavaScript. Quantity * total = total then total 1+total2 = Final total.
Hello Expert,
I have this file is working: http://www.caf-fca.org/english/test/ The forms is working ALL.
As JavaScript i want you to help me or write me the script to
In the Quantity
If the user put Quantity = 1 , the total will be $ 3.00 then if he put 2, the total will be $6.00 right
Samething for the french one.
And the total field will be the addition of the English total and the French total.
Thank you for your time.
I have this file is working: http://www.caf-fca.org/english/test/ The forms is working ALL.
As JavaScript i want you to help me or write me the script to
In the Quantity
If the user put Quantity = 1 , the total will be $ 3.00 then if he put 2, the total will be $6.00 right
Samething for the french one.
And the total field will be the addition of the English total and the French total.
Thank you for your time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You're the BEST !!! I'll add another question in JavaScript to make 2 fields mandatory fields right now...
ASKER
--------------------------
<html>
<body>
<form name="YourFormName" method="Post" action="confirmation.asp">
<table>
<tr><td width="109">Company Name: </td>
<td width="383"><input type="text" name="txtCompanyName" size="50"></td></tr>
<tr><td>Address: </td>
<td><input type="text" name="txtAddress" size="50"></td></tr>
<tr><td>City: </td>
<td><input type="text" name="txtCity" size="50"></td></tr>
<tr><td>Postal Code: </td>
<td><input type="text" name="txtPostalCode1" value="" size="3"> - <input type="text" name="txtPostalCode2" value="" size="3"></td></tr>
<tr><td>Email: </td>
<td><input type="text" name="txtEmail" size="50"></td></tr>
<tr><td>Comments: </td>
<td><textarea name="Comments"></textarea
<tr>
<td colspan="2"><div align="right">
<table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr bgcolor="#FFFFCC" class="byline">
<td width="14%" class="byline"><strong>Qua
<td width="54%" class="byline"><strong>Des
<td width="16%" class="byline"><strong>Pri
<td width="16%" class="byline"><div align="center"><strong>TOT
</tr>
<tr bgcolor="#FFFFCC" class="byline">
<td><div align="center"><input name="QuantityEnglish" type="text" id="QuantityEnglish" size="3"></div></td>
<td class="byline">Making it Work! (English)</td>
<td><div align="center"><p class="byline">$3.00</p></
<td><div align="center"><p class="byline">$ <input name="TotalEnglish" type="text" id="TotalEnglish" size="5"></p></div></td>
</tr>
<tr bgcolor="#FFFFCC" class="byline">
<td><div align="center"><input name="QuantityFrench" type="text" id="QuantityFrench" size="3"></div></td>
<td class="byline">Pour arriver à des résultats! (French)</td>
<td><div align="center"><p class="byline">$3.00</p></
<td><div align="center"><p class="byline">$ <input name="TotalFrench" type="text" id="TotalFrench" size="5"></p></div></td>
</tr>
<tr bgcolor="#FFFFCC" class="byline">
<td> </td>
<td> </td>
<td class="byline"><div align="center">TOTAL</div>
<td><div align="center"><p class="byline">$ <input name="TOTAL" type="text" id="TOTAL" size="5"></p></div></td>
</tr>
</table>
</tr>
</table>
</td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit Form">
</form>
</body>
</html>
--------------------------
And this is source code for the confirmation.asp
==========================
<%
DIM strEmail, strName, strComments, objMail
strName = request.form("Name")
strComments = request.form("Comments")
Set objMail = Server.CreateObject("CDONT
objMail.From = "info@caf-fca.org"
objMail.Subject = "Thank you Elie"
objMail.To = "elie_azzi@caf-fca.org"
objMail.Body = "Email: " & strEmail & vbCrLf & _
"Name: " & strFirstName & vbCrLf & _
"Comments: " & vbCrLf & strComments
objMail.BodyFormat=0
objMail.MailFormat=0
objMail.Importance = 2
objMail.body="<html>" & VBCrLF & "<Title></Title>" & VBCrLf & "<Head></Head>" & VBCrLf & "<Body>" & vbCrLf & _
"<h3><center><font color=red>Making it work! - Online Order</font></center></h3>
"<h3><font color=Blue>Making it work!</font></h3>" & VBCrLf & _
"<p><strong>Date Submitted:</strong> " & Now() & VBCrLf & VBCrLf & _
"<h3><font color=Blue>Making it work!</font></h3>" & VBCrLf & _
"<p><strong>Company Name:</strong> " & Request.Form("txtCompanyNa
"<p><strong>Address:</stro
"<p><strong>City:</strong>
"<p><strong>Postal Code:</strong> " & Request.Form("txtPostalCod
"<p><strong>Your Email:</strong> " & Request.Form("txtEmail") & VBCrLf & VBCrLf & _
"<p><strong>Your English Quantity : </strong> " & Request.Form("QuantityEngl
"<p><strong>Your English Quantity Total : $</strong> " & Request.Form("TotalEnglish
"<p><strong>Your French Quantity :</strong> " & Request.Form("QuantityFren
"<p><strong>Your French Quantity Total: $</strong> " & Request.Form("TotalFrench"
"<p><strong>The Final Total is : $ </strong> " & Request.Form("Total") & VBCrLf & VBCrLf & _
"</body>" & VBCrLf & "</html>"
objMail.Send
Set objMail = nothing
%>
<P>
<%
strName = request.form("Name")
Response.Write strName
%>,</P>
<P>Thank you for emailing me.</P>
=========================
Thank you for your time!!!
Ely.