Good day all:

I'm wondering how does one go about excluding a particular item on a form from being taxed?

I have a check box, which onclick, calculates the sales taxes on all items on the form.

to perform the tax calculation, I'm using:

var tax = ($('#taxbox').attr('checked')) ? (subtotal * taxRate) : 0;
    $('#tax').val(isNaN(tax) ? errorMsg : tax.toCurrency());//Display value or 'error' if calculation failed

Any ideas on how this can be done?

Best,

Have you tried to disable it or hide it?

Thanks danny12 for the reply; unfortunetly, the problem is a bit more complicated. Let me make the problem a little more clearer:

My form consist of 1 table row, in which I have a cascading pair of select boxes. The first select box contains data that determines the content of the second box and then the content of three other html elements.

Now this process can be added to the form dynamically. So the issue is that I may have some selection that I want to be tax exempted while other not.

So essentially, I'm wondering if such tax exclusion could be done based on some sort of flag inputted at the db level and then flagged at selection point? and if so, how so?

I need the form to keep the total taxes on all taxable items separately. It would be something like:

item1=(selected) | item1_subucat=(selected) | qty=2 | cost=$$ | item1_total =$$$
(notax) item2=(selected) | item2_subucat=(selected) | qty=3 | cost=$$ | item1_total =$$$

subtotal = $$$$$
tax =$$$
total $$$

Pardon the terrible schematic, but it is something like this that I'm trying to implement.

Any thoughts!
Mossa

you are working via php and using jquery with json?
If you do than this will be more easy
And from what I understand you need a calculator for a tax
I would aproach this problem with exclusive chechboxes this is something like this when you have 3 checkboxes let's say never monthly weekly than when you select monthly you disable the other two I think this is a good way to achieve what you want
If not try to show a live example or a example of what you want to build
best regards dany12

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.