Thread: Javascript

    #1
  1. No Profile Picture
    Tag Heuer
    Guest
    Devshed Newbie (0 - 499 posts)
    I am looking for a java script that will automatically calculate the price for a said quantity.
    I am only working with one set price. All that I need is to have the script calculate the quantity entered by the customer to get the total price.
  2. #2
  3. No Profile Picture
    falcon
    Guest
    Devshed Newbie (0 - 499 posts)
    This really isn't very hard, you could probably learn how to do it yourself.

    <script language="javascript">
    <!--
    function calculate() {
    var result = <?price?> *
    parseInt(document.form.textbox.value);
    }
    -->
    </script>

    -------------------------------

    You'll need to work out the event handler. Probably an onClick event of a submit button.

    Falcon

Similar Threads

  1. External JavaScript file problem
    By FTK2003 in forum JavaScript Development
    Replies: 11
    Last Post: September 13th, 2003, 11:21 AM
  2. External JavaScript file from within a JavaScript function?
    By DKDiveDude in forum JavaScript Development
    Replies: 10
    Last Post: August 19th, 2003, 03:24 AM
  3. delimiting javascript
    By scream in forum JavaScript Development
    Replies: 3
    Last Post: August 15th, 2003, 04:03 PM
  4. Executing External Javascript from a Popup window. - How do I...
    By Bitzen in forum JavaScript Development
    Replies: 3
    Last Post: August 2nd, 2003, 04:31 AM
  5. getting javascript error when using PHP and javascript
    By Dalamar in forum JavaScript Development
    Replies: 8
    Last Post: December 17th, 2001, 07:41 AM

IMN logo majestic logo threadwatch logo seochat tools logo