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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s