I have a Javascript function that's fired on the onclick event of a button on my webform. It's possible for invalid parameters to be passed to the function, in which case I'd like to throw an error so that the browser can report to the user that something went wrong, and that they might want to check their configuration settings. However, throwing an error causes a postback as the return false; statement is never reached.
In this situation, what sort of feedback can/should I give to the user? I don't particularly want to throw up an alert as I'd prefer something more subtle. Any/all suggestions appreciated.
Try Catch Finally in JavaScript Using exception handling you can throw the error as well as return the control as false based on your certain conditions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With