开发者

jQuery autocomplete on / off functionality

开发者 https://www.devze.com 2022-12-27 13:56 出处:网络
I am working on website (built using PHP, MySQL, jQuery) which require that admin set a variable in configuration and according to that configuration variable jQuery autocomplete is enabled or disable

I am working on website (built using PHP, MySQL, jQuery) which require that admin set a variable in configuration and according to that configuration variable jQuery autocomplete is enabled or disabled to all website.

Is t开发者_如何学编程here any way to achieve that functionality?


Sure, just set a variable on the header, end of the body, or wherever you need to

echo '<script type="text/javascript">
    var autocomplete= '.$configuration['autocomplete'].';
</script>'; 

and work it from there.


ok, you have some initialization function there, so check if autocomplete must be on/off in that function and not initialize that what you need, or do it. i dont see any problems to realize here..

function profiles_autocompletes_init(mode){

        ....check it here.... :)

    $("#"+mode+"ProfileSelecter").autocomplete("/autocomplete/profiles/", {
        ...
    }); 
}
0

精彩评论

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