Hi,
In SignupAPI extension, should I fire the Ajax user validation (username available & not illegal checking) 'onchange' / 'onkeyup' ?
1) 'onchange' would cause less Ajax calls but will give result only when the user has pressed tab or clicks to the next field
2) 'onkeyup' would cause a lot of Ajax calls but would give result as & when the user types so that he can correct the input if needed rather than going to the next field & then finding that he just gave some invalid input in the previous field
What would be better from a UX + Performance point of view? Is there any other JavaScript event I should be looking at?
Thanks Akshay
Akshay Agarwal schrieb:
Hi,
In SignupAPI extension, should I fire the Ajax user validation (username available& not illegal checking) 'onchange' / 'onkeyup' ?
The illegal character logic could be implemented in JS. Or at least a part of it, and an ajax request only onchange. For example don't forget to send no request for an empty input form.
- 'onchange' would cause less Ajax calls but will give result only when
the user has pressed tab or clicks to the next field
- 'onkeyup' would cause a lot of Ajax calls but would give result as&
when the user types so that he can correct the input if needed rather than going to the next field& then finding that he just gave some invalid input in the previous field
You may use the combination of onkeyup with a timeout of about 200ms. That will reduce lots of ajax calls, it's no live search but a validation.
What would be better from a UX + Performance point of view? Is there any other JavaScript event I should be looking at?
Watch for the events "paste", "change", "input", "mouseup" and "keyup", that should get all.
Bergi
Akshay Agarwal schrieb:
Hi,
In SignupAPI extension, should I fire the Ajax user validation (username available& not illegal checking) 'onchange' / 'onkeyup' ?
The illegal character logic could be implemented in JS. Or at least a part of it, and an ajax request only onchange. For example don't forget to send no request for an empty input form.
- 'onchange' would cause less Ajax calls but will give result only when
the user has pressed tab or clicks to the next field
- 'onkeyup' would cause a lot of Ajax calls but would give result as&
when the user types so that he can correct the input if needed rather than going to the next field& then finding that he just gave some invalid input in the previous field
You may use the combination of onkeyup with a timeout of about 200ms. That will reduce lots of ajax calls, it's no live search but a validation.
What would be better from a UX + Performance point of view? Is there any other JavaScript event I should be looking at?
Watch for the events "paste", "change", "input", "mouseup" and "keyup", that should get all.
Bergi
Bergi wrote:
The illegal character logic could be implemented in JS. Or at least a part of it, and an ajax request only onchange. For example don't forget to send no request for an empty input form.
Yes, no Ajax calls are made for blank input, I would see into implementing the Illegal name logic at client side.
You may use the combination of onkeyup with a timeout of about 200ms. that will reduce lots of ajax calls, it's no live search but a validation.
Thats really a nice idea. I would do that.
Watch for the events "paste", "change", "input", "mouseup" and "keyup", that should get all.
Would have a look into those events as well.
Does anyone have any more ideas on this topic?
Thanks Akshay Agarwal
wikitech-l@lists.wikimedia.org