Click here to Skip to main content
15,312,347 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to do a calculation on
qty * rate = amount
amount - discount + taxes = bill amount
bill amount + round off = net amount

I know it can be done easily, but the problem is that any one can change the value through inspect element. To stop that I have to recalculate the values again in server
side and this will make the work duplicate and increase the chances of error from developer side.

please suggest me the right way...

1 solution

The right way is to do both client and server side validation. Never rely exclusively on client side validation because it can be altered or hacked.
then what about work duplicacy, is there any way to do it on server side only (dry model).

any body please help me..
ZurdoDev 28-Sep-15 8:31am
Do the calculation on client side but then verify it on server side.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900