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

#   select custom field onchange

##

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

Less More

- Posts: 61
- Thank you received: 3
-
-

2 years 2 months ago [\#363120](#363120) by [demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")  *[select custom field onchange](/forum/27-checkout/908599-select-custom-field-onchange#363120 "-- HikaShop version -- : 5.1.1 -- Joomla version -- : 5.1.4 -- PHP version -- : 8.2  Hi i have created a custom field of type dropdown i was ablout to write a function to run on its onchange event, which i noticed hikashop dropdowns already has a onchange attribute with a function.  is there anyposibilities that i can add my function to the dropwon too ?")* was created by *[demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")*

-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.1.4
-- PHP version -- : 8.2

Hi
i have created a custom field of type dropdown
i was ablout to write a function to run on its onchange event, which i noticed hikashop dropdowns already has a onchange attribute with a function.

is there anyposibilities that i can add my function to the dropwon too ?

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

2 years 2 months ago [\#363122](#363122) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[select custom field onchange](/forum/27-checkout/908599-select-custom-field-onchange#363122 "-- HikaShop version -- : 5.1.1 -- Joomla version -- : 5.1.4 -- PHP version -- : 8.2  Hi i have created a custom field of type dropdown i was ablout to write a function to run on its onchange event, which i noticed hikashop dropdowns already has a onchange attribute with a function.  is there anyposibilities that i can add my function to the dropwon too ?")*

Sure.
You don't need to add an onchange attribute to an element to get it to call your javascript code.
You can add an event listener:
[ developer.mozilla.org/en-US/docs/Web/API...get/addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
Here is an example for the change event:
[ developer.mozilla.org/en-US/docs/Web/API...Element/change\_event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)

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

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