On 6/30/09 9:03 AM, "hobbesdev" <hobbes...@googlemail.com> wrote:

> 
> hi,
> 
> i have in input element where the user can enter multiple email
> addresses (like in thunderbirds to: field)
> i use autocomplete to make suggestions form the database when the user
> enters new adresses.
> then i want to validate the emailadresses before sending the email,
> because the user can add email addresses by 1.) lookup or 2 manual editing
> so i used validate with
> 
> var validator = $j("#werkeForm").validate({
>             rules: {
>                 empfaenger:{
>                     required: true,
>                     minlength:2,
>                     remote: "ajaxserver2.php?cmd=chkEmail"
>                     },
>     ....
>    
> now the problem seems to be a kind of race condition, cause both methods
> try to operate on the input field.
> 
> firebug shows me that each method takes only a few milliseconds, but
> combined they take up to 3 secondes after every keystroke.
> 
> is there any advice on how to combine these both plugins?

could you try invoking the undocumented method .unautocomplete() before
invoking validate()?

i don't know how fancy your validation is but with fancy autocompletion
happening it might be easier on the user if email address validation only
happens on form submit. that approach would allow you to turn off
autocompletion before doing any validation.


Reply via email to