473,687 Members | 3,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple two numbers then result sum with another number

2 New Member
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 1980
ThatThatGuy
449 Recognized Expert Contributor
posting such long code snippets will not help...

summarise your point please
Dec 30 '09 #2
merkam
2 New Member
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 Recognized Expert Contributor
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 Recognized Expert Specialist
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 Recognized Expert Specialist
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
746
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 together and the square root of the product is returned and displayed for the user. The function should return a double. Hint: If you multiply an integer by 1.0 the result will be a double. For example:
4
8941
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 file of numerical data results where it could contain values such as: <RESULT>0.12345</RESULT> when created in English, but it could contain: <RESULT>0,12345</RESULT> when created in another language... such as German or French. One developer...
16
2453
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 (se below) then I run a query giving me a running total, which give me the first stock in the batch purchased by an individual, then I use this number and add the number of shares in order to find the number of the individuals' last share. So...
13
4225
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 between 0 and 100? (call rand() only 10 times...) Thanks, qq
32
14848
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 ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
17
12781
by: Sri | last post by:
How do you add an n-bit number in C? Regards, Sri
60
4907
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 'target' programming community herein) to get some community input and verify (or not) the following two statements. Few programmers (3 to7%) UNDERSTAND 'Strategic Functional Migration
2
3003
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 later. It starts look more difficult. I was hopeing someone might have a very easy way to do it that I don't know about... The BOM structure looks like this.. Father Child A 1 A 2
7
16555
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 called "Point" which would have two values "x" and "y". Now, let's say if it were the Java version, I would want two constructors: one that accept two numbers, the other accepts a string:
13
2803
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, or between 0 and 99999 (inclusive). Further, the I want the range to be a variable. Concretely, I would like to create the following method: unsigned long Random( unsigned long num )
0
8527
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8781
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8784
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7621
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6453
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5806
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4321
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4543
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.