Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

calculate two number and diplay next field without reload the page javascript

var text1 = document.getElementById("Text1");
var text2 = document.getElementById("Text2");

function add_number() {
   var first_number = parseFloat(text1.value);
   if (isNaN(first_number)) first_number = 0;
   var second_number = parseFloat(text2.value);
   if (isNaN(second_number)) second_number = 0;
   var result = first_number + second_number;
   document.getElementById("txtresult").value = result;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #calculate #number #diplay #field #reload #page #javascript
ADD COMMENT
Topic
Name
9+2 =