Dependent Custom Field - Trigger on Core field value?

  • Duke S.
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
2 weeks 5 hours ago #127220 by Duke S.
The selection of Master Fields to setup a Dependent Field does not include any Core fields. Is there a way to have the dependent property set so the field will display when the number of people/tickets in #eb-form-number-group-members matches a value? I want to display different dependent field checkbox options depending on the number in the group.

If I need to do this with a javascript override, please suggest which file I should be working in.

Please Log in or Create an account to join the conversation.

More
2 weeks 2 hours ago #127223 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Dependent Custom Field - Trigger on Core field value?
Hello Duke

I would say that it's hard.For displaying purpose, you just need to look at the code components/com_eventbooking/themes/default/register/group_members.php and display fields base on data of number registrants

However, the difficulty is with data validation (if the field is required). If it's hidden, users could not enter data and it will cause wrong validation. You will then have to customize code in validate_and_store_group_members_data method in the file components/com_eventbooking/controller/register.php

In short, it's hard, so maybe you should find a different way to handle your requirement

Tuan

Please Log in or Create an account to join the conversation.

  • Duke S.
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 week 6 days ago #127237 by Duke S.
Helpful suggestions, thank you

Please Log in or Create an account to join the conversation.

More
1 week 6 days ago #127242 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Dependent Custom Field - Trigger on Core field value?
You're welcome. Hope you will be be able to customize code to meet your need. Just want to make it clear that you should implement the customization using override so that the change won't be lost when you update to future releases of the extension:

1. Once modification is done to the file components/com_eventbooking/themes/default/register/group_members.php, you need to copy that modified file to PATH_TO_TEMPLATE/html/com_eventbooking/register folder so that the change won't be lost when you update to future releases of the extension

2. For the customization to validate_and_store_group_members_data method, see instructions at eventbookingdoc.joomservices.com/develop...n-a-controller-class to see how to implement it as override

Regards,

Tuan
The following user(s) said Thank You: Duke S.

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc