Input – PHP Autocomplete https://phpautocomplete.com The Ultimate PHP Dropdown Thu, 09 Feb 2023 22:23:51 +0000 en-US hourly 1 https://wordpress.org/?v=7.0.4 set_min_input_length() https://phpautocomplete.com/docs/set_min_input_length/ Fri, 14 Feb 2014 17:50:29 +0000 http://phpautocomplete.com/?p=142 Minimum number of characters required to start a search. System default is 0 (no minimum restriction).

Signature:

public function set_min_input_length(integer $minimumInputLength = 2)

Parameters:

  • $minimumInputLength: Minimum input length
]]>
set_max_input_length() https://phpautocomplete.com/docs/set_max_input_length/ Fri, 14 Feb 2014 17:49:51 +0000 http://phpautocomplete.com/?p=141 Maximum number of characters that can be entered to start a search. System default is 10 characters.

Signature:

public function set_max_input_length(integer $maximumInputLength = 10)

Parameters:

  • $maximumInputLength: Maximum input length
]]>
SELECT or INPUT? https://phpautocomplete.com/examples/select-or-input/ Tue, 04 Feb 2014 00:03:03 +0000 http://phpautocomplete.com/?p=72 The PHP Autocomplete can be attached an existing HTML Select or an hidden input field.When attached to a Select tag, pass “SELECT” to display() method; or “INPUT” when attached to a hidden Input field. The default value value is “INPUT” when left it blank. e.g.

$pac -> display("SELECT");

So when to use SELECT or INPUT? If you want to transform an existing HTML Select tag into auto-complete control, use “SELECT”; otherwise, use “INPUT” referencing to an input type=’hidden’ tag. In order to take advantage of custom data, use “INPUT”, otherwise data is parsed from Select’s option tags.

<?php
$data =
    array(
        array('id'=>1, 'text'=>'Japan'),
        array('id'=>2, 'text'=>'USA'),
        array('id'=>3, 'text'=>'Hong Kong'),
        array('id'=>4, 'text'=>'Canada'),
        array('id'=>5, 'text'=>'Brazil')
    );
$pac = new C_PhpAutocomplete('country', $data);
$pac -> display();
?>
<input type="hidden" id="country">
]]>