[Skip to main content](#vessel-content)

#   Change the select to input &lt;DataList&gt;

##

- **[Vorov](/forum/user/34642-vorov "View Vorov's Profile")**
- [![Vorov's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34642.gif)](/forum/user/34642-vorov "View Vorov's Profile") Topic Author
- [ Offline](/forum/user/34642-vorov)

Less More

- Posts: 37
- Thank you received: 0
-
-

11 years 10 months ago [\#184349](#184349) by [Vorov](/forum/user/34642-vorov "View Vorov's Profile")  *[Change the select to input &lt;DataList&gt;](/forum/45-filters-search/873839-change-the-select-to-input-datalist#184349 "-- HikaShop version -- : 2.3.4. -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  how to change the output filter select? there is code in which when data is entered displayed information data.  change the select to input          filter.php (1439) if($filter-&gt;filter&#95;data=='custom&#95;field'){ $field=parent::getFields($filter, $datas); if(isset($field-&gt;field&#95;value) &amp;&amp; is&#95;array($field-&gt;field&#95;value)){ foreach($field-&gt;field&#95;value as $val){ $selectedItem=''; if(!empty($selected) &amp;&amp; in&#95;array($val&#91;0&#93;, $selected)){ $selectedItem='selected=&quot;selected&quot;'; } if(empty($val&#91;0&#93;) &amp;&amp; $field-&gt;field&#95;required) continue; $html.=''.JText::&#95;($val&#91;1&#93;).''; } } }")* was created by *[Vorov](/forum/user/34642-vorov "View Vorov's Profile")*

-- HikaShop version -- : 2.3.4.
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29

how to change the output filter select? there is code in which when data is entered displayed information data.

change the select to input &lt;DataList&gt;

&lt;input name="indexCombobox1" type="text" list="indexCombobox1_datalist" id="indexCombobox1"&gt;
&lt;datalist id="indexCombobox1_datalist"&gt;
&lt;option label="City1" value="City1"&gt;
&lt;option label="City2" value="City2"&gt;
&lt;option label="City3" value="City3"&gt;
&lt;/datalist&gt;

filter.php (1439)
if($filter-&gt;filter_data=='custom_field'){
$field=parent::getFields($filter, $datas);
if(isset($field-&gt;field_value) &amp;&amp; is_array($field-&gt;field_value)){
foreach($field-&gt;field_value as $val){
$selectedItem='';
if(!empty($selected) &amp;&amp; in_array($val[0], $selected)){
$selectedItem='selected="selected"';
}
if(empty($val[0]) &amp;&amp; $field-&gt;field_required) continue;
$html.='&lt;OPTION '.$selectedItem.' name="'.$filter-&gt;filter_data.'" value="'.$val[0].'"&gt;'.JText::_($val[1]).'&lt;/OPTION&gt;';
}
}
}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3MzgzOS1jaGFuZ2UtdGhlLXNlbGVjdC10by1pbnB1dC1kYXRhbGlzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Vorov](/forum/user/34642-vorov "View Vorov's Profile")**
- [![Vorov's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34642.gif)](/forum/user/34642-vorov "View Vorov's Profile") Topic Author
- [ Offline](/forum/user/34642-vorov)

Less More

- Posts: 37
- Thank you received: 0
-
-

11 years 10 months ago [\#184350](#184350) by [Vorov](/forum/user/34642-vorov "View Vorov's Profile")  Replied by *[Vorov](/forum/user/34642-vorov "View Vorov's Profile")* on topic *[Change the select to input &lt;DataList&gt;](/forum/45-filters-search/873839-change-the-select-to-input-datalist#184350 "-- HikaShop version -- : 2.3.4. -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  how to change the output filter select? there is code in which when data is entered displayed information data.  change the select to input          filter.php (1439) if($filter-&gt;filter&#95;data=='custom&#95;field'){ $field=parent::getFields($filter, $datas); if(isset($field-&gt;field&#95;value) &amp;&amp; is&#95;array($field-&gt;field&#95;value)){ foreach($field-&gt;field&#95;value as $val){ $selectedItem=''; if(!empty($selected) &amp;&amp; in&#95;array($val&#91;0&#93;, $selected)){ $selectedItem='selected=&quot;selected&quot;'; } if(empty($val&#91;0&#93;) &amp;&amp; $field-&gt;field&#95;required) continue; $html.=''.JText::&#95;($val&#91;1&#93;).''; } } }")*

[ cz.bo62.ru/](http://cz.bo62.ru/)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3MzgzOS1jaGFuZ2UtdGhlLXNlbGVjdC10by1pbnB1dC1kYXRhbGlzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 10 months ago [\#184358](#184358) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change the select to input &lt;DataList&gt;](/forum/45-filters-search/873839-change-the-select-to-input-datalist#184358 "-- HikaShop version -- : 2.3.4. -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  how to change the output filter select? there is code in which when data is entered displayed information data.  change the select to input          filter.php (1439) if($filter-&gt;filter&#95;data=='custom&#95;field'){ $field=parent::getFields($filter, $datas); if(isset($field-&gt;field&#95;value) &amp;&amp; is&#95;array($field-&gt;field&#95;value)){ foreach($field-&gt;field&#95;value as $val){ $selectedItem=''; if(!empty($selected) &amp;&amp; in&#95;array($val&#91;0&#93;, $selected)){ $selectedItem='selected=&quot;selected&quot;'; } if(empty($val&#91;0&#93;) &amp;&amp; $field-&gt;field&#95;required) continue; $html.=''.JText::&#95;($val&#91;1&#93;).''; } } }")*

Hi,

You want to change the code: Code:

$html.='&lt;SELECT '.$multiple.$onClick.' size='.$filter-&gt;filter_options['filter_size'].' name="filter_'.$filter-&gt;filter_namekey.$tab.'" id="filter_'.$filter-&gt;filter_namekey.'_'.$divName.$tab.'"&gt;';

to: Code:

$html.='&lt;input '.$multiple.$onClick.' size='.$filter-&gt;filter_options['filter_size'].' name="filter_'.$filter-&gt;filter_namekey.$tab.'" id="filter_'.$filter-&gt;filter_namekey.'_'.$divName.$tab.'" list="filter_'.$filter-&gt;filter_namekey.'_'.$divName.$tab.'_datalist" /&gt;&lt;datalist id="filter_'.$filter-&gt;filter_namekey.'_'.$divName.$tab.'_datalist"&gt;';

and the code: Code:

$html.='&lt;/SELECT&gt;';

to: Code:

$html.='&lt;/datalist&gt;';

in the file administrator/components/com_hikashop/classes/filter.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3MzgzOS1jaGFuZ2UtdGhlLXNlbGVjdC10by1pbnB1dC1kYXRhbGlzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Vorov](/forum/user/34642-vorov "View Vorov's Profile")**
- [![Vorov's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34642.gif)](/forum/user/34642-vorov "View Vorov's Profile") Topic Author
- [ Offline](/forum/user/34642-vorov)

Less More

- Posts: 37
- Thank you received: 0
-
-

11 years 10 months ago [\#184393](#184393) by [Vorov](/forum/user/34642-vorov "View Vorov's Profile")  Replied by *[Vorov](/forum/user/34642-vorov "View Vorov's Profile")* on topic *[Change the select to input &lt;DataList&gt;](/forum/45-filters-search/873839-change-the-select-to-input-datalist#184393 "-- HikaShop version -- : 2.3.4. -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  how to change the output filter select? there is code in which when data is entered displayed information data.  change the select to input          filter.php (1439) if($filter-&gt;filter&#95;data=='custom&#95;field'){ $field=parent::getFields($filter, $datas); if(isset($field-&gt;field&#95;value) &amp;&amp; is&#95;array($field-&gt;field&#95;value)){ foreach($field-&gt;field&#95;value as $val){ $selectedItem=''; if(!empty($selected) &amp;&amp; in&#95;array($val&#91;0&#93;, $selected)){ $selectedItem='selected=&quot;selected&quot;'; } if(empty($val&#91;0&#93;) &amp;&amp; $field-&gt;field&#95;required) continue; $html.=''.JText::&#95;($val&#91;1&#93;).''; } } }")*

[ reklammma.ru/](http://reklammma.ru/) - scary obtained (((( Task failed
Mr. Nicolas, is it possible to chicagop be used to select this plugin? - [ ivaynberg.github.io/select2/index.html](http://ivaynberg.github.io/select2/index.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3MzgzOS1jaGFuZ2UtdGhlLXNlbGVjdC10by1pbnB1dC1kYXRhbGlzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 10 months ago [\#184399](#184399) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change the select to input &lt;DataList&gt;](/forum/45-filters-search/873839-change-the-select-to-input-datalist#184399 "-- HikaShop version -- : 2.3.4. -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  how to change the output filter select? there is code in which when data is entered displayed information data.  change the select to input          filter.php (1439) if($filter-&gt;filter&#95;data=='custom&#95;field'){ $field=parent::getFields($filter, $datas); if(isset($field-&gt;field&#95;value) &amp;&amp; is&#95;array($field-&gt;field&#95;value)){ foreach($field-&gt;field&#95;value as $val){ $selectedItem=''; if(!empty($selected) &amp;&amp; in&#95;array($val&#91;0&#93;, $selected)){ $selectedItem='selected=&quot;selected&quot;'; } if(empty($val&#91;0&#93;) &amp;&amp; $field-&gt;field&#95;required) continue; $html.=''.JText::&#95;($val&#91;1&#93;).''; } } }")*

Hi,

This indicates an error.
Please turn on the error reporting and debug mode of the Joomla configuration and it will display an error message explaining what is the problem.
Please provide the content of the line with the error and the exact error message so that we can tell you what to do next.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3MzgzOS1jaGFuZ2UtdGhlLXNlbGVjdC10by1pbnB1dC1kYXRhbGlzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Vorov](/forum/user/34642-vorov "View Vorov's Profile")**
- [![Vorov's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34642.gif)](/forum/user/34642-vorov "View Vorov's Profile") Topic Author
- [ Offline](/forum/user/34642-vorov)

Less More

- Posts: 37
- Thank you received: 0
-
-

11 years 10 months ago [\#184513](#184513) by [Vorov](/forum/user/34642-vorov "View Vorov's Profile")  Replied by *[Vorov](/forum/user/34642-vorov "View Vorov's Profile")* on topic *[Change the select to input &lt;DataList&gt;](/forum/45-filters-search/873839-change-the-select-to-input-datalist#184513 "-- HikaShop version -- : 2.3.4. -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  how to change the output filter select? there is code in which when data is entered displayed information data.  change the select to input          filter.php (1439) if($filter-&gt;filter&#95;data=='custom&#95;field'){ $field=parent::getFields($filter, $datas); if(isset($field-&gt;field&#95;value) &amp;&amp; is&#95;array($field-&gt;field&#95;value)){ foreach($field-&gt;field&#95;value as $val){ $selectedItem=''; if(!empty($selected) &amp;&amp; in&#95;array($val&#91;0&#93;, $selected)){ $selectedItem='selected=&quot;selected&quot;'; } if(empty($val&#91;0&#93;) &amp;&amp; $field-&gt;field&#95;required) continue; $html.=''.JText::&#95;($val&#91;1&#93;).''; } } }")*

Figured out. To display in the list correctly I removed the line

$html.='&lt;OPTION VALUE="filter_'.$filter-&gt;filter_namekey.'"&gt;'.JText::_( 'HIKA_ALL' ).'&lt;/OPTION&gt;';

[ reklammma.ru/](http://reklammma.ru/)

The filter works as it should. A drop-down list bad showed zone - country_russia26.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3MzgzOS1jaGFuZ2UtdGhlLXNlbGVjdC10by1pbnB1dC1kYXRhbGlzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.079 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
