Notice: This site is now in read-only mode and will no longer be updated.
Please visit our new and improved Knowledge Base at https://kb.joget.org/ for the latest content and updates.
hi I am new to javascript and I am trying lear this but due to time constraint, I asking the team help on this .I have done some research on. this and found multiple solution but non of them is working for me kindly help is in this. please find the jquery which I have written.
I am trying to get the total value of to text field
<script> //$(".input").on('input',function() //{ // var x = document.getElementById('text1').value; // x = parseInt(x);
// var y = document.get.ElementById('text2').value; // y = parseInt(y);
function doMath() { // Capture the entered values of two input boxes var d1 = document.getElementById('text1').value; var d2 = document.getElementById('text2').value;
// Add them together and display var sum = parseInt(text1) + parseInt(text2); document.getElementById('result').value = parseInt(sum); } </script>
hi I am new to javascript and I am trying lear this but due to time constraint, I asking the team help on this .I have done some research on. this and found multiple solution but non of them is working for me kindly help is in this. please find the jquery which I have written.
I am trying to get the total value of to text field
<script>
//$(".input").on('input',function()
//{
// var x = document.getElementById('text1').value;
// x = parseInt(x);
// var y = document.get.ElementById('text2').value;
// y = parseInt(y);
// document.getElementById('result').value = x+y;
//});
//$('input[name="text1"], input[name="text2"]').input( function(){
// d1 = $('input[name="text1"]').textid('value');
// d2 = $('input[name="text2"]').textid('value');
// diff = d1+d2;
// $('input[name=result]').val(diff);
//});
function doMath()
{
// Capture the entered values of two input boxes
var d1 = document.getElementById('text1').value;
var d2 = document.getElementById('text2').value;
// Add them together and display
var sum = parseInt(text1) + parseInt(text2);
document.getElementById('result').value = parseInt(sum);
}
</script>