Sales Tax Calculator

P1x44r

New member
Want to improve this, but time does not permit sadly. I created this tool to calculate proper amount to pay when ordering out. Very lazy code that I'm not proud of, so hoping someone will post back a more flexible version of this calculator.

Right now it's obviously configured to Quebec, Canada, but those constants could be changed in the code easily to suit your needs. IE support was not tested and I suspect it will NOT work under it. I run this in Firefox.

Download Sales Tax Calculator

View Live Demo

Files Included:
  • index.php - HTML form.
  • tax.css - CSS to make it a little prettier.
  • tax.js - function fired on form submit which posts to the PHP page below with AJAX. Handles the return as well.
  • tax.ajx.php - PHP code to calculate and return tax amounts.
 
Wait, so you want someone to debug your code, and reprogram it for you, for free? :bleh:
:confused:


I didn't ask to debug it as it's working perfectly fine as it is and suits my needs 100%. What I meant that if you want something like this for own needs, you can take this as a base since only minor modifications are needed to make this work for any state/province.

If, and only if, you felt like giving back to the community, you could post the modified code here because it might be useful to others (not to me, because what I attached above already works for me).
 
:confused:


I didn't ask to debug it as it's working perfectly fine as it is and suits my needs 100%. What I meant that if you want something like this for own needs, you can take this as a base since only minor modifications are needed to make this work for any state/province.

If, and only if, you felt like giving back to the community, you could post the modified code here because it might be useful to others (not to me, because what I attached above already works for me).

Shall I be awkward then, and just say cheers for it? I've no pressing need for the code at the moment (I'm more an ASP kind of a guy), but full source code of another language is always appreciated. Much more interesting, in a geek sense, than tutorials.

Rep'ed.
 
Shall I be awkward then, and just say cheers for it? I've no pressing need for the code at the moment (I'm more an ASP kind of a guy), but full source code of another language is always appreciated. Much more interesting, in a geek sense, than tutorials.

Rep'ed.
Thank you.

That's exactly why I posted this here. Even if one person finds it interesting and/or useful in some way, it has been worth it for me. :cool:
 
Back
Top