I've tried to approach the problem from different angles, but
unsuccessfully.

Let's suppose the following scenario (that's what I'm working on right now
actually).

You have an event registration form and you may register another
participant with you; you're using suggestion (autocomplete) to enter other
participant's name; if this person is already in the system, field is
marked with a checkmark; if not, user is prompted to enter email so the
system could send an invitation upon form completion.

What do we need to implement it?

1) handle autocompletion selection event (that's already done, the
resulting mixin is pretty straightforward once you realize the mechanics of
jQuery autocomplete).
2) update the form based on autocompletion result.

Now, here is a problem:

- if we use a component event request that updates form zone, yes, we can
get what we want, but everything user has entered into other fields is
lost; obviously this is not acceptable

- if we trigger form submission (it's possible to do that using hidden
submit, it's not very elegant, but it works), we have to go through form
validation which fails in most cases because at this point form is not yet
completed; user receives non-relevant validation errors

- FormInjector might be a solution, but it can only add something to a
form, rather than update its current controls

So none of the above can actually solve the problem.

Are there any other approaches to this?

-- 
Ilya Obshadko

Reply via email to