473,385 Members | 1,730 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,385 software developers and data experts.

multiple two numbers then result sum with another number

2
hi,
i need a script that:
step1: multiple n*1200= m
n=0 or 1 or 2 ...
step2: sum m+10+20
i have this script
i don't now how to assign span with id="five" to value in checkbox plz help me
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="sum.aspx.vb" Inherits="sum" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>sum</title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.  
  12.         <table width="auto" border="0" cellspacing="10" cellpadding="2" align="center">            
  13.             <tr>
  14.                 <td colspan="2" align="center"> </td>
  15.             </tr>
  16.  
  17.         </table>
  18.         <table >
  19.           <tr align="center">
  20.                                 <td class="ContentCell">
  21.                                     1</td>
  22.                                 <td class="ContentCell">
  23.                                     Loop</td>
  24.                                 <td class="ContentCell">
  25.                                     171</td>
  26.                                 <td class="ContentCell" align="center">
  27.                                     <input onclick="clickCh(this)" type="checkbox" runat="server" id="txtAdaRate" name="one"
  28.                                         value="171" />
  29.                                 </td>
  30.                             </tr>
  31.                             <tr align="center">
  32.                                 <td class="ContentCell">
  33.                                     2</td>
  34.                                 <td class="ContentCell">
  35.                                     Loop rate</td>
  36.                                 <td class="ContentCell">
  37.                                     115</td>
  38.                                 <td class="ContentCell" align="center">
  39.                                     <input onclick="clickCh(this)" type="checkbox" runat="server" id="txtFixRate" name="two"
  40.                                         value="115" />
  41.                                 </td>
  42.                             </tr>
  43.                             <tr align="center">
  44.                                 <td class="ContentCell">
  45.                                     3</td>
  46.                                 <td class="ContentCell">
  47.                                     Loop bridge </td>
  48.                                 <td class="ContentCell">
  49.                                     1153</td>
  50.                                 <td class="ContentCell" align="center">
  51.                                     <input onclick="clickCh(this)" type="checkbox" runat="server" id="txtBridTap" name="three"
  52.                                         value="1153" />
  53.                                 </td>
  54.                             </tr>
  55.                             <tr align="center">
  56.                                 <td class="ContentCell">
  57.                                     4</td>
  58.                                 <td class="ContentCell">
  59.                                    test</td>
  60.                                 <td class="ContentCell">
  61.                                     45</td>
  62.                                 <td class="ContentCell" align="center">
  63.                                     <input onclick="clickCh(this)" type="checkbox" runat="server" id="txtThroTest" name="four"
  64.                                         value="45" />
  65.                                 </td>
  66.                             </tr>
  67.                             <tr align="center">
  68.                                 <td class="ContentCell">
  69.                                     5</td>
  70.                                 <td class="ContentCell">
  71.                                     Latency test</td>
  72.                                 <td class="ContentCell">
  73.                                     122200</td>
  74.                                 <td class="ContentCell" align="center">
  75.                                 <input type="text" name="mah" id="Text1" size="4" value="1" border="0" style="font-size:16px;font-weight:bold;align:center" onchange="upPrice(this.value);" onkeyup="upPrice(this.value);">
  76.                                 <span id="five" style="font-size:12px;">25,000</span>
  77.                                     <input onclick="clickCh(this)" type="checkbox" runat="server" 
  78.                                         name="five" value="session("span.five")" />
  79.                                 </td>
  80.                             </tr>
  81.                             <tr>
  82.                                 <td class="ContentCell" colspan="2" align="center">
  83.  
  84.                                 </td>
  85.                                 <td class="ContentCell" colspan="2">
  86.                                     <input id="total" type="text" name="total" runat="server" readonly="readonly" style="font-family: Tahoma;
  87.                                         font-size: 12px;" />
  88.                                 </td>
  89.                             </tr>
  90.         </table>
  91.         <script language="JavaScript" type="text/javascript">
  92. var total = document.getElementById("total")
  93. function clickCh(caller){
  94. if(caller.checked){
  95. add(caller)
  96. } else {
  97. subtract(caller)
  98. }
  99. }
  100. function add(caller){ total.value = total.value*1 + caller.value*1}
  101. function subtract(caller){ total.value = total.value*1 - caller.value*1}
  102.     </script>
  103.             <script language ="javascript" >
  104.  
  105.         function upPrice(m){
  106.             m=parseInt(m);
  107.             if(m>=0){
  108.                 span=document.getElementById('five');
  109.                 perM=13398948;
  110.                 span.innerHTML=formatNUM((perM*m));
  111.             }else{
  112.                 span.innerHTML='';
  113.             }
  114.         }
  115.         function formatNUM(number) {
  116.                 var nStr = '' + Math.round(parseFloat(number) * 100) / 100;
  117.                 var x = nStr.split('.');
  118.                 var x1 = x[0];
  119.                 var x2 = x.length > 1 ? '.' + x[1] : '';
  120.                 var rgx = /(\d+)(\d{3})/;
  121.                 while (rgx.test(x1)) {
  122.                     x1 = x1.replace(rgx, '$1' + ',' + '$2');
  123.                 }
  124.                 return x1 + x2;
  125.             };
  126.  
  127.         </script>
  128.     </form>
  129. </body>
  130. </html>
Dec 30 '09 #1
5 1968
ThatThatGuy
449 Expert 256MB
posting such long code snippets will not help...

summarise your point please
Dec 30 '09 #2
merkam
2
hi,
i need a script that:
step1: multiple n*1200= m
n=0 or 1 or 2 ... user input n
step2: sum m+10+20
such as
10
20
n*1200
sum = 10+20+n*1200
user can select 10 or 20 and input n
Dec 30 '09 #3
ThatThatGuy
449 Expert 256MB
i doubt its not a home work question.....
and i think bytes has a policy that we don't help school kids with their home work..

that's bcoz you have asked a very simple question... sorry
Dec 30 '09 #4
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Dec 30 '09 #5
tlhintoq
3,525 Expert 2GB
Bytes has a policy regarding assisting students with their homework.

The short version is that the volunteers here can't help you with schoolwork.
A) We don't know what material you have and have not learned in class.
B) We don't know the guidelines you must follow.
C) In the long run giving you the answers actually short changes your education.
Dec 30 '09 #6

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

Similar topics

2
by: cplusplus | last post by:
Hello, I have newbie question. I'm stuck on this current assignment. Write a program that prompts the user for two integer values, passes the values to a function where they are multiplied...
4
by: John Bowman | last post by:
Hi, A couple Q's , so I've come to the experts<g>. 1) I need a definitive answer to the following debate. I've got a couple developers who disagree on the following question. We've got an XML...
16
by: StenKoll | last post by:
Help needed in order to create a register of stocks in a company. In accordance with local laws I need to give each individual share a number. I have accomplished this by establishing three tables...
13
by: quickcur | last post by:
Suppose I have a function rand() that can generate one integer random number between 0 and 100. Suppose also rand() is very expensive. What is the fastest way to generate 10 different random number...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
17
by: Sri | last post by:
How do you add an n-bit number in C? Regards, Sri
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
2
by: pengbsam | last post by:
Hello: I need to write a program that search through multiple level BOM, get all the items. It seems like a easy enough project, but when I put my hands on it and couple of hundred lines of codes...
7
by: andrewfsears | last post by:
I have a question: I was wondering if it is possible to simulate the multiple constructors, like in Java (yes, I know that the languages are completely different)? Let's say that I have a class...
13
by: Peter Oliphant | last post by:
I would like to be able to create a random number generator that produces evenly distributed random numbers up to given number. For example, I would like to pick a random number less than 100000,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.