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.
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
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