- Posts: 61
- Thank you received: 3
select custom field onchange
- demoisellegol
-
Topic Author
- Offline
Less
More
2 years 3 weeks ago #363120
by demoisellegol
select custom field onchange was created by demoisellegol
-- 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 ?
-- 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 or Create an account to join the conversation.
2 years 3 weeks ago #363122
by nicolas
Replied by nicolas on topic select custom field onchange
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
Here is an example for the change event:
developer.mozilla.org/en-US/docs/Web/API...Element/change_event
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
Here is an example for the change event:
developer.mozilla.org/en-US/docs/Web/API...Element/change_event
Please Log in or Create an account to join the conversation.
Time to create page: 0.159 seconds