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

#   Custom field: Display limited to multiple values

##

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile") Topic Author
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

10 years 8 months ago [\#233738](#233738) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  *[Custom field: Display limited to multiple values](/forum/27-checkout/883197-custom-field-display-limited-to-multiple-values#233738 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.5.  Hi,  I would like to display a custom field only if some post code are typed (post code is a text type field). I'm trying with &quot;Display limited to&quot; function but I can insert only one value. ex. 20100 How can I show a field &quot;display limited to&quot; a list of values? ex. &quot;20100,20109,20394...&quot;?  Regards, Simone")* was created by *[simonev](/forum/user/30589-simonev "View simonev's Profile")*

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.

Hi,

I would like to display a custom field only if some post code are typed (post code is a text type field). I'm trying with "Display limited to" function but I can insert only one value. ex. 20100
How can I show a field "display limited to" a list of values? ex. "20100,20109,20394..."?

Regards,
Simone

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4MzE5Ny1jdXN0b20tZmllbGQtZGlzcGxheS1saW1pdGVkLXRvLW11bHRpcGxlLXZhbHVlcz90bXBsPW1hcmtkb3du) 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: 86584
- Thank you received: 14325
-
-

10 years 8 months ago [\#233773](#233773) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field: Display limited to multiple values](/forum/27-checkout/883197-custom-field-display-limited-to-multiple-values#233773 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.5.  Hi,  I would like to display a custom field only if some post code are typed (post code is a text type field). I'm trying with &quot;Display limited to&quot; function but I can insert only one value. ex. 20100 How can I show a field &quot;display limited to&quot; a list of values? ex. &quot;20100,20109,20394...&quot;?  Regards, Simone")*

Hi,

The system isn't made to support that.
It would require custom coding.

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

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile") Topic Author
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

10 years 8 months ago [\#233778](#233778) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Custom field: Display limited to multiple values](/forum/27-checkout/883197-custom-field-display-limited-to-multiple-values#233778 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.5.  Hi,  I would like to display a custom field only if some post code are typed (post code is a text type field). I'm trying with &quot;Display limited to&quot; function but I can insert only one value. ex. 20100 How can I show a field &quot;display limited to&quot; a list of values? ex. &quot;20100,20109,20394...&quot;?  Regards, Simone")*

Thanks for your answer, could you please suggest me how should I edit it? or the file to edit?
any information about is really appreciated. ![:)](/media/kunena/emoticons/3.png ":)")

Thank you,
Simone

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4MzE5Ny1jdXN0b20tZmllbGQtZGlzcGxheS1saW1pdGVkLXRvLW11bHRpcGxlLXZhbHVlcz90bXBsPW1hcmtkb3du) 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: 86584
- Thank you received: 14325
-
-

10 years 8 months ago [\#233787](#233787) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field: Display limited to multiple values](/forum/27-checkout/883197-custom-field-display-limited-to-multiple-values#233787 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.5.  Hi,  I would like to display a custom field only if some post code are typed (post code is a text type field). I'm trying with &quot;Display limited to&quot; function but I can insert only one value. ex. 20100 How can I show a field &quot;display limited to&quot; a list of values? ex. &quot;20100,20109,20394...&quot;?  Regards, Simone")*

Hi,

So first, custom address fields are displayed in several places. So you'll have to edit the file "custom_fields" (or custom_fields_bootstrap if the use bootstrap design setting is activated on your HikaShop configuration) of the view "user" for the registration form. And the file "form" of the view "address" for the address edition form.

There, you want to change the line:
' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"',
which handles the toggling of the fields when a field is changed.
I would recommend to add there a call to a custom javascript function with this.value and only add that call if the field is the post code field (you can check $fieldName for that).
Then, to your own check in your javascript function and hide/display the line you want with a getElementById on the id of the row in the DOM.

The following user(s) said Thank You: [simonev](/forum/user/30589-simonev "View simonev's Profile")

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

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile") Topic Author
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

10 years 7 months ago [\#238006](#238006) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Custom field: Display limited to multiple values](/forum/27-checkout/883197-custom-field-display-limited-to-multiple-values#238006 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.5.  Hi,  I would like to display a custom field only if some post code are typed (post code is a text type field). I'm trying with &quot;Display limited to&quot; function but I can insert only one value. ex. 20100 How can I show a field &quot;display limited to&quot; a list of values? ex. &quot;20100,20109,20394...&quot;?  Regards, Simone")*

Hi,

I made changes as you suggested and everything work great, thank you.
I'm using "popup mode” to change adresses in checkout and everything works updating form.php in address view.
Now I would change "popup mode" to "list" but if I do it the code in form.php is not render in page.
Is there another file to edit in order to let works the feature also in "list" lode?

Thank you,
Simone

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4MzE5Ny1jdXN0b20tZmllbGQtZGlzcGxheS1saW1pdGVkLXRvLW11bHRpcGxlLXZhbHVlcz90bXBsPW1hcmtkb3du) 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: 86584
- Thank you received: 14325
-
-

10 years 7 months ago [\#238015](#238015) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field: Display limited to multiple values](/forum/27-checkout/883197-custom-field-display-limited-to-multiple-values#238015 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.5.  Hi,  I would like to display a custom field only if some post code are typed (post code is a text type field). I'm trying with &quot;Display limited to&quot; function but I can insert only one value. ex. 20100 How can I show a field &quot;display limited to&quot; a list of values? ex. &quot;20100,20109,20394...&quot;?  Regards, Simone")*

Hi,

In that case, you want to do that change in the "show" file of the "address" view.

The following user(s) said Thank You: [simonev](/forum/user/30589-simonev "View simonev's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4MzE5Ny1jdXN0b20tZmllbGQtZGlzcGxheS1saW1pdGVkLXRvLW11bHRpcGxlLXZhbHVlcz90bXBsPW1hcmtkb3du) 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.060 seconds

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