- Posts: 76
- Thank you received: 1
Require event submission field for specific access level/group only?
- LMKweb
- Topic Author
- Offline
- Senior Member
-
Less
More
1 year 11 months ago #158331
by LMKweb
Require event submission field for specific access level/group only? was created by LMKweb
Is it possible to have a field on the frontend simple event submission form that is required only for a specific access level/usergroup? The use case is that people purchase a subscription using Membership Pro, then can add events in Events Booking using the simple frontend submission form. The lowest subscription level is required to use the "custom URL registration handle" field because we will not allow them to accept event registrations through the site. I'd like to make that field required for that access level or usergroup only, so that it's optional for the higher level subscribers.
Thank you!
Thank you!
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
1 year 11 months ago #158333
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Require event submission field for specific access level/group only?
Hi
Unfortunately, it is not supported. We could not allow you to control every single field on submit event form base on user access level. So you will need to customize code of the extension if you want to have it works like that
Regards,
Tuan
Unfortunately, it is not supported. We could not allow you to control every single field on submit event form base on user access level. So you will need to customize code of the extension if you want to have it works like that
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- LMKweb
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 76
- Thank you received: 1
1 year 11 months ago #158348
by LMKweb
Replied by LMKweb on topic Require event submission field for specific access level/group only?
OK thank you! In that case, is it possible to require a field for everyone on the event submission form? I didn't see a way to turn that on.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
1 year 11 months ago #158350
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Require event submission field for specific access level/group only?
There are many fields on submit event form, so it is hard/impossible for the system to allow you to configure which field to be required/optional. So you will need some coding knowledge to customize the code. In your specific case, you can use this code:
Replace 2 with ID of the access level which you want to make the field required. That should work.
Tuan
Code:
if ($this->config->get('fes_show_custom_registration_handle_url', 1))
{
if (in_array(2, Factory::getUser()->getAuthorisedViewLevels()))
{
$requiredValidation = ' validate[required]';
}
else
{
$requiredValidation = '';
}
?>
<div class="<?php echo $controlGroupClass; ?>">
<div class="<?php echo $controlLabelClass; ?>">
<?php echo EventbookingHelperHtml::getFieldLabel('registration_handle_url', Text::_('EB_CUSTOM_REGISTRATION_HANDLE_URL'), Text::_('EB_CUSTOM_REGISTRATION_HANDLE_URL_EXPLAIN')); ?>
</div>
<div class="<?php echo $controlsClass; ?>">
<input type="url" name="registration_handle_url" id="registration_handle_url"
class="input-xxlarge form-control<?php echo $requiredValidation; ?>" size="10" value="<?php echo $this->item->registration_handle_url; ?>" />
</div>
</div>
<?php
}
Replace 2 with ID of the access level which you want to make the field required. That should work.
Tuan
The following user(s) said Thank You: LMKweb
Please Log in or Create an account to join the conversation.
- LMKweb
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 76
- Thank you received: 1
1 year 11 months ago #158381
by LMKweb
Replied by LMKweb on topic Require event submission field for specific access level/group only?
Thanks Tuan! We've actually decided to require it for everyone, though I'm going to save this code for future use in case that changes. How would I modify that code to require it for everyone?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
1 year 11 months ago #158388
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Require event submission field for specific access level/group only?
You can use the following code:
I'm sorry to say but you would need to have a developer to help you if you want to customize the code. I could not always be available to provide code support for your change requests like this. I would expect that you know basic PHP/Joomla programming so that with the code I sent you earlier, you could adapt it to meet your need.
Regards,
Tuan
Code:
if ($this->config->get('fes_show_custom_registration_handle_url', 1))
{
?>
<div class="<?php echo $controlGroupClass; ?>">
<div class="<?php echo $controlLabelClass; ?>">
<?php echo EventbookingHelperHtml::getFieldLabel('registration_handle_url', Text::_('EB_CUSTOM_REGISTRATION_HANDLE_URL'), Text::_('EB_CUSTOM_REGISTRATION_HANDLE_URL_EXPLAIN')); ?>
</div>
<div class="<?php echo $controlsClass; ?>">
<input type="url" name="registration_handle_url" id="registration_handle_url"
class="input-xxlarge form-control validate[required]" size="10" value="<?php echo $this->item->registration_handle_url; ?>" />
</div>
</div>
<?php
}
I'm sorry to say but you would need to have a developer to help you if you want to customize the code. I could not always be available to provide code support for your change requests like this. I would expect that you know basic PHP/Joomla programming so that with the code I sent you earlier, you could adapt it to meet your need.
Regards,
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.