AnsweredAssumed Answered

Autocomplete text input reset after repaint

Question asked by greenawayr Champion on May 5, 2016

Hi,

I have implemented some javascript using SPServices so that our users get an autocomplete prompt on a text box.

The problem I'm facing is that I have a lookup control on the form that has a filter based on our text box. This does a postback to invoke the filter, I'm finding that I'm getting some odd behaviour because of this.

If the autocomplete option is clicked on using the mouse, the form performs it's postback but my text box only contains the letters that were typed in by the user.

Example - user types ABC and then selects ABC Ltd, once postback occurs text box only displays ABC. So therefore my filtered drop down doesn't work.

 

The other scenario is that the user cursors down to ABC Ltd and then tabs out of the control. This doesn't seem to do a postback at all so the filter doesn't kick in.

 

I have a number of Calculated Values using the runtime lookup fuction and that works perfectly of course. So is there a relatively painless way for someone who is not a JS expert, to perform an action so that as soon as the textbox loses focus, the value selected in the autocomplete will be "confirmed" into the text box before the postback occurs, or if they cursor down to it, does the same, then forces the postback.

 

That or some way of pushing the filtered values into the lookup column in runtime rather than performing the postback.

 

Thanks in advance

Outcomes