Computers & Internet Logo

Related Topics:

Posted on Jun 29, 2011

Create javascript code whose function is to compute the sum of two inputs?

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

  • Contributor 7 Answers
  • Posted on Jun 29, 2011
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

Joined: Jun 29, 2011
Answers
7
Questions
0
Helped
1634
Points
20

Hello,
The following code will dynamically calculate the some of the first two fields:



Enter first number:
Enter second number:
Their sum is:

Best Regards, Ben

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

0helpful
1answer

How i install javascript

JavaScript is a browser-based scripting language used by millions of websites. It allows programmers to create Web pages capable of delivering dynamic functionality and in-page refreshing that can be interpreted by any modern browser. Because JavaScript has often been used to deploy pop-ups and other distracting page elements, some users opt to disable the technology. Fortunately, whether you use Internet Explorer, Firefox, Opera or Safari on your Windows 7 computer, you can re-enable JavaScript with only a few clicks.

Read more : http://www.ehow.com/how_8132036_enable-javascript-windows-7.html
0helpful
1answer

I need a code of a simple login form with the output

<?php
require("db/config.php");
session_start();
if(isset($_POST["btnLogin"]))
{
$nm=$_POST["txtUid"];
$pas=$_POST["txtPass"];

$q=mysql_query("select * from userinformationtb where user_id='$nm' and password='$pas'");
$data=mysql_fetch_array($q);
$_SESSION["seid"]=$data["user_id"];

// session_id();
if($nm==$_SESSION["seid"])
{


header("location:php/home.php");
//echo "valid";
}
else
{
echo "invalid";
}

}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
type="text/javascript" src="js/script.js">
type="text/javascript" src="js/cufon-yui.js">
type="text/javascript" src="js/arial.js">
type="text/javascript" src="js/cuf_run.js">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>

src="js/jquery-1.8.2.min.js" type="text/javascript">

src="js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8">

src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8">

>
jQuery(document).ready(function(){
// binds form submission and fields to the validation engine
jQuery("#frmLogin").validationEngine();
});

</head>

<body>

<form id="frmLogin" name="frmLogin" method="post" action="">

<table width="548" border="0" id="txtbrder">

<tr>
<td width="90" height="">Enter User Id </td>
<td width="152"><label>
<input name="txtUid" type="text" id="txtUid" class="tnm validate[required,custom[email]] text-input" />
</label></td>
<td width="56"><div align="left">Password</div></td>
<td width="154"><label>
<input name="txtPass" type="password" id="txtPass" class=" tnm validate[required] text-input validate[required,minSize[6]] text-input" />
</label></td>
<td width="74"><label>
<input name="btnLogin" type="submit" id="btnLogin" value="LogIn" style="background:#0000FF;color:#fff;"/>

</label></td>
</tr>
</table>
<a href="php/userinfo.php">Create New Account</a> &nbsp;&nbsp;&nbsp;&nbsp;
<a href="php/forgotpassword.php"> Forgot Password ?</a>
</form>
</div>
</body>
</html>
1helpful
1answer

Javascript code equivalent to PHP given below.

You can load a XML fie from JavaScript like this:
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
function loadXML(xmlFile)
{
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load(xmlFile);
xmlObj=xmlDoc.documentElement;
}


http://www.sitepoint.com/article/server-side-xml-javascript/
0helpful
1answer

A Program using an array that culculates the sum and average of the five input values?

Hi,
I am writing in C code here
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,sum=0;
float avg=0;
printf("enter the five values");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
for(i=0;i<5;i++)
sum+=a[i];
printf("Sum=%d",sum);
avg=sum/5;
printf("Average=%f",avg);
getch();
}
0helpful
1answer
1helpful
1answer

How to call Javascript function on click event of Flash Button while clicking on button

try this:

create a button and in the actions window, add:

on(release){
getURL("javascript:myJsFunction();");
}

ensure you have the js function loaded into your parent page...

regards
0helpful
1answer

Pls. help me

Q.2#  Dim n, sum as Double
Dim i as Integer
n=100
sum=0

for i=1 to n
sum=sum+1/n
next i

Q.3#  Dim sum as Double
sum=0
for i=1 to 99
if i%2 <> 0 then sum=sum+i end if
next i
0helpful
1answer

Javascript code for generation of textbox on clicking

Kapil, Pretty much just copy and paste that and change the title part in parentheses. Play with the code a little bit and see what you come up with. Be sure to keep backups each time you make a change! Code <html><head><title>(Type a title for your page here)</title>

<script type="text/javascript">
function make_blank()
{
document.form1.type.value ="";
}
</script>

</head>
<body >

<form name=form1 method=post action='test.php'>
<b>Type</b><input type=text name=type value='Enter your user id' onclick="make_blank();">Enter User ID
<input type=submit value=Submit> </form>

</body>
</html>
-------------- Good luck and take care,
Chimpster
0helpful
2answers

Javascript code for Flash Button's click event

you need to create functions & your own defined set of commands and then call those functions with the flash custom made buttons.
it will work fine.
Not finding what you are looking for?

145 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

Brad Brown

Level 3 Expert

19187 Answers

Cindy Wells

Level 3 Expert

6688 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...