Multiplication of two input values and the Result will be shown in total input using JQuery

Hello Friends today i am going to show you one magic using jquery

if you have two inputs says amount1 and amount2

and you want its multiplication shown in total input field.

Here is a small jquery,you just need to pass the id of input fields.

<script type=”text/javascript”>
$(document).ready(function(){
$(‘input’).change(function(){
var amount1=$(‘#amount1’).val();
var amount2=$(‘#amount2’).val();
var Total=amount1*amount2;
$(‘#total’).attr(‘value’, Total);
});
});
</script>

you will need to add its main jquery file,and this will work.

try this out magic…………………!!!!!!!!!!!!!!!!!

Advertisements