Sunday, June 30, 2019

Product Solver in JavaScript

Here is a simple program that I wrote using JavaScript to ask the user to give two numbers and then it will convert it to its product equivalent. I convert my code into a mobile application using Adobe Cordova which can be installed in any Android devices such as Smart Phones and Android Tablets. I hope you will find my work useful.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Program Listing

<!-- Jake R. Pomperada  -->
<!-- May 3, 2019  -->
<!-- Bacolod City, Philippines -->
<!DOCTYPE html>
<html>
<head>
    <title>Product Solver</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

</head>

<body>
 <script type="text/javascript">
     
     function Product() {
    var v1 = document.getElementById('txtNum1').value;
    var v2 = document.getElementById('txtNum2').value;
    if (v1 == "" || v2 == "") {
        alert('Both Values Required');
    } else {
        document.getElementById('lblResult').innerText = (Number(v1) * Number(v2));
    }
}

function Clear_All() {
     document.getElementById('txtNum1').value="";
     document.getElementById('txtNum2').value="";
     document.getElementById('lblResult').innerText="";
     document.getElementById('txtNum1').focus();
}
  </script>
    <div data-role="page">

        <div data-role="header">
            <h4>Product Solver</h4>
            <p align="center">Created By <b>Jake R. Pomperada </b></p>
        </div>
        <!-- /header -->

        <div data-role="content">
     
            <label for="txtNum1">First Value </label>
            <input id="txtNum1" name="txtNum1" type="text" value="" />
            <label for="txtNum2">Second Value </label>
            <input id="txtNum2" name="txtNum2" type="text" value="" /> <a data-inline="true" data-role="button"  onclick="Product();">Product</a>
            <a data-inline="true" data-role="button"  onclick="Clear_All();">Clear</a>
             &nbsp&nbsp Result : <label id="lblResult"></label>

        </div>
        <!-- /content -->

        <div data-role="footer">
            <h4>Servo Software Bacolod City  2019</h4>
        </div>


    </div>
    <!-- /page -->

</body>

</html>


No comments:

Post a Comment