fabiomcosta / mootools-meio-autocomplete

A complete mootools Autocomplete plugin
http://www.meiocodigo.com/projects/meio-autocomplete/
32 stars 14 forks source link

If you submit the form with onSelect(), the valueField isn't updated already. #33

Open RiZKiT opened 10 years ago

RiZKiT commented 10 years ago

If you want to submit the form with onSelect() and need a synced value field, you have the problem that the value field isn't updated already. It's a problem of the event handling of fireEvent('select'), because the value field is synced with that event, too.

A pragmatic solution is to slightly delay the form submit, like formElement.submit.delay(10, formElement), a bit better is it to periodically check the valueElement value with the provided data.value.

A perfect solution might be extending the plugin with another event, but that might be more work then one want to afford.