0
Answer

Client side validation, do postpack on validation error

felix reychman

felix reychman

12y
1.8k
1
Hi! I have a problem regarding client side validation. I have an applicaiton with a few pages of profile registration. My customer is very specific on how they want this to work, and although I don't think it's the best way to do things, this is how they want it, and I can't do anything about that. I just have to fix it. This is how they want it: 1. All information should always be automatically saved upon leaving any page in the registration. 2. In case there's a validation error, the user should be given a "Do you really want to leave without saving?"-option. (Which can of course be easily validated serverside.) In order to ask the question, I need to validate, and in case of validation error, I need to, for example, set a flag that determines wether I should ask the question or not. However, the automatically generated code allows for no such thing. It simply breaks the postback, displays the error messages, and that's it. No chance of going on. It's completely based on a Cancel or Abort option, which I am not allowed to use. (No, please don't ask me why!!!) I could, but really don't want to, generate all the client side validation code, copy it, and make hardcoded javascripts from it, and then manually rehack that. Finally - My question: Is there any way to change the behavior after a validation error in a client side script?