473,396 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

sum checker

Hi I have this code I would want to check if the amount total on submit = the sum available to send please just run the code it will make more sense thank sin advance.

Davibugi

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function my_message() {
  3. var flg=confirm('Are you sure you have entered the correct amounts? If yes.\n\nClick OK to continue. Otherwise click Cancel.\n');
  4. if (flg)return true;
  5. return false;
  6. } </script> 
  7. <style type="text/css">
  8. <!--
  9. .style10 {color: #004200;
  10.     font-family: Verdana, Arial, Helvetica, sans-serif;
  11.     font-size: 9px;
  12.     font-style: normal;
  13.     line-height: normal;
  14.     font-weight: normal;
  15.     font-variant: normal;
  16.     text-transform: capitalize;
  17. }
  18. .style11 {color: #004200; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-style: normal; line-height: normal; font-weight: bold; font-variant: normal; text-transform: capitalize; }
  19. .style12 {color: #000000}
  20. -->
  21. </style>
  22. <table width="342" cellspacing="0">
  23.   <!--DWLayoutTable-->
  24.   <tr>
  25.     <td width="3" height="26" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  26.     <td width="327" valign="top"><div align="left">
  27.       <?php 
  28.      $thanks = "Thank you";
  29.      $name = "$surname";
  30.      $doido = "for using Carribean Overseas Services to do your money transfer. You have";
  31.      $money = "$dispatch";
  32.      $to = "to transfer.";
  33.      $us="US$";
  34.     echo $thanks . " " . $name . " " . $doido . " " . $money . "" . $us . " " . $to;
  35.  
  36.      ?>
  37.     </div></td>
  38.   </tr>
  39.   <tr>
  40.     <td colspan="2" valign="top"><form id="form1" name="form1" method="post" action="thanks2.php">
  41.       <table width="311" height="470" border="0">
  42.         <!--DWLayoutTable-->
  43.         <tr>
  44.           <td width="1"></td>
  45.           <td height="1"></td>
  46.           <td></td>
  47.           <td></td>
  48.         </tr>
  49.         <!--DWLayoutTable-->
  50.         <tr>
  51.           <td></td>
  52.           <td width="101" height="18" class="style11"> beneficiaries' details</td>
  53.           <td height="18" colspan="2"><!--DWLayoutEmptyCell-->&nbsp;</td>
  54.         </tr>
  55.         <tr>
  56.           <td></td>
  57.           <td height="20" valign="top" class="style10"><div align="left">Name</div></td>
  58.           <td width="75" valign="top"><input name="name1" type="text" class="style10" id="name1" size="15" /></td>
  59.           <td width="121" valign="top"><input name="name2nd" type="text" class="style10" id="name2nd" size="15" /></td>
  60.         </tr>
  61.         <tr>
  62.           <td></td>
  63.           <td height="20" valign="top" class="style10">ID number </td>
  64.           <td colspan="2" valign="top"><input name="idnumber" type="text" class="style10" id="idnumber" size="25" /></td>
  65.         </tr>
  66.         <tr>
  67.           <td></td>
  68.           <td height="20" valign="top" class="style10">Telephone No </td>
  69.           <td colspan="2" valign="top"><input name="telephone" type="text" class="style10" id="telephone" size="25" /></td>
  70.         </tr>
  71.         <tr>
  72.           <td></td>
  73.           <td height="20" valign="top" class="style10"><div align="left">Amount to pay </div></td>
  74.           <td colspan="2" valign="top"><input name="amount_give" type="text" class="style10" id="amount_give" size="25" /></td>
  75.         </tr>
  76.         <tr>
  77.           <td></td>
  78.           <td height="14" valign="top" class="style11"><!--DWLayoutEmptyCell-->&nbsp;</td>
  79.           <td colspan="2"><span class="style11">2</span></td>
  80.         </tr>
  81.         <tr>
  82.           <td></td>
  83.           <td height="20" valign="top" class="style10">Name</td>
  84.           <td valign="top"><input name="name2" type="text" class="style10" id="name2" size="15" /></td>
  85.           <td valign="top"><input name="name2_2nd" type="text" class="style10" id="name2_2nd" size="15" /></td>
  86.         </tr>
  87.         <tr>
  88.           <td></td>
  89.           <td height="20" valign="top" class="style10">ID number </td>
  90.           <td colspan="2" valign="top" class="style10"><input name="2nd_IdNumber" type="text" class="style10" id="2nd_IdNumber" /></td>
  91.         </tr>
  92.         <tr>
  93.           <td></td>
  94.           <td height="20" valign="top" class="style10">Telephone No </td>
  95.           <td colspan="2" valign="top"><span class="style10">
  96.             <input name="Telenumber2" type="text" class="style10" id="Telenumber2" />
  97.           </span></td>
  98.         </tr>
  99.         <tr>
  100.           <td></td>
  101.           <td height="20" valign="top" class="style10">Amount to pay </td>
  102.           <td colspan="2" valign="top"><input name="Amount_give2" type="text" class="style10" id="Amount_give2" /></td>
  103.         </tr>
  104.         <tr>
  105.           <td></td>
  106.           <td height="14" valign="top" class="style10"><!--DWLayoutEmptyCell-->&nbsp;</td>
  107.           <td height="14" valign="top" class="style11">3</td>
  108.           <td height="14" valign="top" class="style10"><!--DWLayoutEmptyCell-->&nbsp;</td>
  109.         </tr>
  110.         <tr>
  111.           <td></td>
  112.           <td height="20" valign="top" class="style10">Names</td>
  113.           <td valign="top"><input name="name3" type="text" class="style10" id="name3" size="15" /></td>
  114.           <td valign="top"><input name="name3_2nd" type="text" class="style10" id="name3_2nd" size="15" /></td>
  115.         </tr>
  116.         <tr>
  117.           <td></td>
  118.           <td height="20" valign="top" class="style10">ID number </td>
  119.           <td colspan="2" valign="top"><input name="IdNumber3rd" type="text" class="style10" id="IdNumber3rd" /></td>
  120.         </tr>
  121.         <tr>
  122.           <td></td>
  123.           <td height="20" valign="top" class="style10">Telephone No </td>
  124.           <td colspan="2" valign="top"><input name="Telno3rd" type="text" class="style10" id="Telno3rd" size="25" /></td>
  125.         </tr>
  126.         <tr>
  127.           <td></td>
  128.           <td height="20" valign="top" class="style10">Amount To pay </td>
  129.           <td colspan="2" valign="top"><input name="Amount_give3rd" type="text" class="style10" id="Amount_give3rd" size="25" /></td>
  130.         </tr>
  131.         <tr>
  132.           <td></td>
  133.           <td height="14" valign="top" class="style10"><!--DWLayoutEmptyCell-->&nbsp;</td>
  134.           <td colspan="2" valign="top" class="style11">4</td>
  135.         </tr>
  136.         <tr>
  137.           <td></td>
  138.           <td height="20" valign="top" class="style10">Names</td>
  139.           <td valign="top"><input name="name4" type="text" class="style10" id="name4" size="15" /></td>
  140.           <td valign="top"><input name="Name4_2nd" type="text" class="style10" id="Name4_2nd" size="15" /></td>
  141.         </tr>
  142.         <tr>
  143.           <td></td>
  144.           <td height="20" valign="top" class="style10">ID number </td>
  145.           <td colspan="2" valign="top"><input name="Idnumber_4th" type="text" class="style10" id="Idnumber_4th" size="25" /></td>
  146.         </tr>
  147.         <tr>
  148.           <td></td>
  149.           <td height="20" valign="top" class="style10">Telephone No </td>
  150.           <td colspan="2" valign="top"><input name="telno_4th" type="text" class="style10" id="telno_4th" size="25" /></td>
  151.         </tr>
  152.         <tr>
  153.           <td></td>
  154.           <td height="20" valign="top" class="style10">Amount To pay </td>
  155.           <td colspan="2" valign="top"><input name="4rdAmount_give" type="text" class="style10" id="4rdAmount_give" size="25" /></td>
  156.         </tr>
  157.         <tr>
  158.           <td></td>
  159.           <td height="22" valign="top"><input name="Continue" type="submit" class="style10" id="Continue" value="Submit" onClick="var flg=my_message(); return flg;" /></td>
  160.           <td colspan="2" valign="top"><input name="Continue2" type="reset" class="style10" id="Continue2" value="reset" onClick="var flg=my_message(); return flg;"/>
  161.               <a href="thanks2.php" class="style12" onClick="var flg=my_message(); return flg;"></a></td>
  162.         </tr>
  163.       </table>
  164.     </form></td>
  165.   </tr>
  166. </table>
  167. <?php
  168. $dispatch = addslashes($_GET['dispatch']);
  169. echo $dispatch;
  170. ?>
Nov 27 '07 #1
3 1192
acoder
16,027 Expert Mod 8TB
Call the function on the form's onsubmit:

[HTML]<form ... onsubmit="return my_message();">[/HTML]
Nov 27 '07 #2
Call the function on the form's onsubmit:

[HTML]<form ... onsubmit="return my_message();">[/HTML]
Hi thanks but how do I do the real calculation
Nov 28 '07 #3
acoder
16,027 Expert Mod 8TB
Hi thanks but how do I do the real calculation
What values need checking? You have four "Amount to Pay"s.

Where's the total to check against?
Nov 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Hank Reed | last post by:
I am trying to use the spell checker on an unbound control in Access 2000. I run the checker in the AfterUpdate event of the control. After the spell checker is done, I get the following message:...
8
by: Joe | last post by:
Hello All: Does anyone know of a spell checker that works with .NET? Any options will be welcome. TIA, -- Joe
13
by: kolmogolov | last post by:
/* Hi, I have removed things irrelevant to reproducing the problem. What's wrong with my code? Thanks in advance for any hint! 1166425362 */ #include <stdio.h> #include <stdlib.h> #include...
4
by: sweetguy1only | last post by:
Hi all, I am a MS Access developer using VB 6 (yes, I know it is a bit old). The problem I am having is, I have a software that allows my customers to put in the information of their clients....
6
by: Neil | last post by:
Is there way to have control over the MS-Access spell checking (besides just launching it)? We want to tell it to check all records, but skip certain fields (or, alternatively, ONLY check certain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.