Let say I have a "sing up" form with a mix of client side and server side validation. This is the validation for the email field:
- Client side validation: required & valid
- Server side (async) validation: unique
The way I would like it to work is for the client side validation (required & valid) to be executed as fast as possible (no throttling - input "afterkeydown") while the server side validation is throttled and executed when the user stops typing.
The problem is that Knockout "throttle extender" returns a new dependentObservable and all the validations are now throttled. I cannot apply throttling individually to the different validation parts.
I thought of creating a second computed email only for the unique/throttled validation but it doesn't make sense as it fires even if the email is not valid and it makes the code more complicated.
Any idea how to make this work without making the solution too crappy?
Edit #1
A good example of what I'm trying to do is the "sign up" form on Twitter website: https://twitter.com/signup. When entering a username, Twitter will automatically check the availability (after some throttling) and give feedback (without having to leave the field).