开发者

Select menu and input box together

开发者 https://www.devze.com 2023-04-04 13:10 出处:网络
My P开发者_JAVA技巧HP code generates options from MySQL db table for JQuery-ui autocomplete combobox http://jqueryui.com/demos/autocomplete/#combobox .

My P开发者_JAVA技巧HP code generates options from MySQL db table for JQuery-ui autocomplete combobox http://jqueryui.com/demos/autocomplete/#combobox . Code looks like that:

 <select id="combobox" name="company">
        <option value="">Select one...</option>
        <?php 
        $query=$db->query("SELECT id, company FROM main");
        while($row=$query->fetch_object())
        {
            echo '<option value="'.$row->id.'">'.$row->company.'</option>';
            }
        ?>
    </select>

I wonder, is there any way to use Jquery-ui combobox as standard text input if there is no available option? I mean, if there's no option like user typed, I want to allow user to enter new data. Is it possible?


You can try this jQuery plugin for that.

0

精彩评论

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