1
0
-1

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>

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Do use the Javascript API#getValue(fieldId) function to gets the value of a form field.

      Explore all the special JS functions for Joget in Javascript API .

        CommentAdd your comment...