Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 17, 2012 01:30 AM by abdu292
Jun 16, 2012 12:24 AM|LINK
I have to perform a calculation compaired to a matrix price list and do a Sales Tax (VAT) calculation, both the TAx info and the price matrix are stored in a database, but basically I will have a text box and when the amount is changed it will need to update
some information on the page.
As far as I can see I have two options,
1, I could send the information to the view and store in a hidden table, and when needed build a JQuery object and use that to do the calculations and append the information to the relavent areas
2, use ajax and send some information to a controller do the calcualtions a return a model and somehow (I assume Json as I have never used it) and update the page
however which is better or which is more standard, also will there be any delays, and is there a way that if they change 1 textbox and it has to do the calculation I have have that run and the user can change another textbox and the repeat happen?
Jun 16, 2012 12:56 AM|LINK
Is your calculation confidential? if not then yes you should always do at client side using jquery.
Jun 16, 2012 07:04 PM|LINK
The calculation is in an area where you need to sign in, but to have permission to use the form you would have permission to change the informaton anyway, and the information is on;y used to enhance the user experience its not stored in any way.
My issue now is actually the caluclation may change depending on the user so I will have to look into how to set that up.
Jun 16, 2012 08:14 PM|LINK
If it is user specific then it is always better to do it on server side. Below resources will help you.
Jun 17, 2012 01:30 AM|LINK
I don't see here that the calculation is too confidential.
If you want to do the calculation as the value changes in the text box, I don't prefer to use, server side calculation, in this case, becuase, it is not a good idea, to send multiple request to server to fetch the same values.
Hope this helps.