JS Pros: The processing occurs on the client side so it doesn't take up more of the server's processing cycle. The submission process can be halted by returning a false value to the onSubmit event of the form tag, allowing the user to fix the information without having to re-generate the page.
JS Cons: If the client has javascript turned off, it won't error check. If someone wants to overflow your SQL query or for some reason enter any form data that you would not normally allow all they need to do is copy the html source, make some minor alterations, and submit it to your site, thus sending incorrect data (buffer overflows, nested select statements, etc). Also, users can view source on your javascript and try to find loopholes you may have missed.
ASP Pros: The data is checked after it is submitted back to the server but before it is submitted to db, so the JS Cons will not have an effect because illegitimate data will be caught before it is used. Since the code is not viewable by users they will not know how you go about your error checking, and thus will have a greater difficuly finding any ackdoors in your error checking.
ASP Cons: Since this is happening after the form submission, if you want the user to fix any mistakes they had in a form they filled out you have to re-generate the form with the values they filled in. The error checking also is occuring server side, slowing down IIS ever so slightly.
Thats what I could think of off the top of my head, hope it helps,
-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.