开发者

jquery Autocomplete : autocomplete does not stop if string does not match

I used the auto-complete function in jque开发者_如何学Pythonry. It's data source are the results from a php-back-end.

$("#ice_id").autocomplete("ice-ver.php", { extraParams : { flavour_id: $("#flavour_id").val() } });

Let us take following example:

We type in the flavour ID 3992 ...(and 3992 exists in the database and is properly returned by the php backend). If we type in now 3992999 the auto-complete function should top showing anything up ...but unfortunately it still does, (could the problem lie within the fact that I am using integers instead of strings or chars?)

Thanks in advance for any hints and best regards

Daniyal


if it's showing something doesn't that mean there is a result from the php code? Check if it's really how you want it, and if you post it someone might be able to help


I agree with shyam. It seems like your PHP-code returns values. Try to request the PHP-script directly in a browser through the-url-to-php-script?flavour_id=3992999.

There are different autocomplete plugins for jquery. If you instead use the one at jquery ui (http://jqueryui.com/demos/autocomplete) your entered value are automatically passed to the URL-resource as the parameter "term". See if that helps you in pinning down the problem with the PHP-script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜