javascript onchange calculate total quantity price demo

Today, We want to share with you javascript calculation form field values.In this post we will show you javascript onchange calculate total quantity price demo, hear for write a javascript program to calculate multiplication and division of two numbers (input from user) we will give you demo and example for implement.In this post, we will learn about jQuery calculate sum of values in all text fields with an example.

How to Auto Calculate Price in Javascript?

Example 1: index.html

<!DOCTYPE html>
<html>
<body>
    <h2>How to Auto Calculate Price in Javascript - www.pakainfo.com</h2>
    <form name="frm-pin" method="post" action="pin-index-a.php">
        <input type="hidden" name="mode" value="PinRequest" />
        <label class="w3-text-green"><b>Number Of Pin</b></label>
        <select name="tot_pin_requested" onchange="findTotalcalculateAmount(this.value)" required>
			<option value="" disabled selected>Choose your option</option>
			<option value="1">1</option>
			<option value="2">2</option>
			<option value="3">3</option>
			<option value="4">4</option>
			<option value="5">5</option>
			<option value="6">6</option>
			<option value="7">7</option>
			<option value="8">8</option>
			<option value="9">9</option>
			<option value="10">10</option>
		</select>
        <label><b>Total SUM Of Amount</b></label>
        <input class="w3-input w3-border" name="totalValue" id="totalValue" type="text" readonly>
        <script>
            function findTotalcalculateAmount(val) {
                var tot_price = val * 100;
                /* see bellow here the result*/
                var divobj = document.getElementById('totalValue');
                divobj.value = tot_price;
            }
        </script>
        <body>
</html>

I hope you get an idea about javascript calculation functions.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.