Jump to content

Search the Community

Showing results for tags 'subtract'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. hi, i am not gud in ajax. i have this code... <html> <head> <title>Sum Html Textbox Values using jQuery/JavaScript</title> <style> body { font-family: sans-serif; } #summation { font-size: 18px; font-weight: bold; color:#174C68; } .txt { background-color: #FEFFB0; font-weight: bold; text-align: right; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> </head> <body> <table width="300px" border="1" style="border-collapse:collapse;background-color:#E8DCFF"> <tr> <td width="40px">1</td> <td>Butter</td> <td><input class="txt" type="text" name="txt"/></td> </tr> <tr> <td>2</td> <td>Cheese</td> <td><input class="txt" type="text" name="txt"/></td> </tr> <tr> <td>3</td> <td>Eggs</td> <td><input class="txt" type="text" name="txt"/></td> </tr> <tr> <td>4</td> <td>Milk</td> <td><input class="txt" type="text" name="txt"/></td> </tr> <tr> <td>5</td> <td>Bread</td> <td><input class="txt" type="text" name="txt"/></td> </tr> <tr> <td>6</td> <td>Soap</td> <td><input class="txt" type="text" name="txt"/></td> </tr> <tr id="summation"> <td> </td> <td align="right">Sum :</td> <td align="center"><span id="sum">0</span></td> </tr> </table> <script> $(document).ready(function(){ //iterate through each textboxes and add keyup //handler to trigger sum event $(".txt").each(function() { $(this).keyup(function(){ calculateSum(); }); }); }); function calculateSum() { var sum = 0; //iterate through each textboxes and add the values $(".txt").each(function() { //add only if the value is number if(!isNaN(this.value) && this.value.length!=0) { sum += parseFloat(this.value); } }); //.toFixed() method will roundoff the final sum to 2 decimal places $("#sum").html(sum.toFixed(2)); } </script> </body> </html> ..........................from net. this will add all the input fields and give us the total of it. but i want one more input field in which when i put some value . then, total amount should be subtracted from it and gives the result.. can anyone give me some suggestions.... please ????? thanks.
  2. I have 2 tables, one named donations and the other named costs. Both have a common column, Amount, I want to Sum each column then take costs away from donations. Is this possible? Thanks for any help. Robbie
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.