Answers.Body: <p>if you setup your custom fields in profiles only for the roles that are needed then does it not automatically only display those fields that are relevant? p.s. we wrote and maintain the extension that your referring to!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-25T13:24:02.507Z
Answers.Text: Been awhile but I wanted to follow up with a question.  
  
  You state above "does it not automatically only display those fields that are relevant"?  
  No it doesn't. It doesn't display the role-specific profile fields at all, only the default profiles selected for the main participants in the Online Registration settings.
  
  What am I missing?  How do I make the role-specific form display only the role-specific profile?
Answers.UserDisplayName: minbori
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-25T21:41:10.897Z
Answers.Text: I should add that the role-specific profiles appear in the backend, but not in the frontend registration form.
Answers.UserDisplayName: minbori
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-06T13:38:20.887Z
Answers.LastActivityDate: 2018-12-06T13:38:20.887Z
Answers.UserDisplayName: Parvez Saleh
Body: <p>My requirement: collect different custom data for different participant roles registering for the same event.</p>
  
  <p>I know this would be simple with Drupal/Webforms but I'm on Joomla -- and this seems to be very difficult without the Webform integration!</p>
  
  <p><a href="https://civicrm.org/extensions/event-registration-based-participant-roles" rel="nofollow noreferrer">This extension</a> (Event Registration Based on Participant Roles) works great to provide the participant role I want to use to my registration form.  However, I can't figure out how to switch to a different custom profile in the registration form based on the participant role.</p>
  
  <p>I've tried using the buildForm hook to add in the specific custom fields I need based on the current participant role, but it seems that buildForm hook does not allow me to REMOVE custom fields that I DON'T want to appear on the form for specific roles. I can only add fields to the array of fields that are already included from the profile selected on the "Online Registration" configuration.</p>
  
  <p>I thought about just using Jquery to hide the fields I don't need from whichever role is currently selected, but that causes validation problems -- and I don't want to have to rewrite validation rules for every participant role context!</p>
  
  <p>I just can't believe this is this difficult, and think I must be missing something obvious.  Or do I really need to hand-code a new, completely standalone registration form for each participant role?</p>
  
  <p>Thanks in advance for your suggestions :-)</p>
  
Tags: <civievent><joomla><registration><online-registration>
Title: CiviEvent: how to collect different custom data for different event participant roles?
ThreadText: # CiviEvent: how to collect different custom data for different event participant roles?
  
  (Asked by: username_0 on 2018-12-06)
  
  My requirement: collect different custom data for different participant roles registering for the same event.
  
  I know this would be simple with Drupal/Webforms but I'm on Joomla -- and this seems to be very difficult without the Webform integration!
  
  [This extension](https://civicrm.org/extensions/event-registration-based-participant-roles) (Event Registration Based on Participant Roles) works great to provide the participant role I want to use to my registration form. However, I can't figure out how to switch to a different custom profile in the registration form based on the participant role.
  
  I've tried using the buildForm hook to add in the specific custom fields I need based on the current participant role, but it seems that buildForm hook does not allow me to REMOVE custom fields that I DON'T want to appear on the form for specific roles. I can only add fields to the array of fields that are already included from the profile selected on the "Online Registration" configuration.
  
  I thought about just using Jquery to hide the fields I don't need from whichever role is currently selected, but that causes validation problems -- and I don't want to have to rewrite validation rules for every participant role context!
  
  I just can't believe this is this difficult, and think I must be missing something obvious. Or do I really need to hand-code a new, completely standalone registration form for each participant role?
  
  Thanks in advance for your suggestions :-)
  
  **Tags:** civievent, joomla, registration, online-registration
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-06. Score: 2 | Accepted answer
  
  if you setup your custom fields in profiles only for the roles that are needed then does it not automatically only display those fields that are relevant? p.s. we wrote and maintain the extension that your referring to!
  
  > **Comments:**
  > **username_0**: Been awhile but I wanted to follow up with a question.    You state above "does it not automatically only display those fields that are relevant"?   No it doesn't. It doesn't display the role-specific profile fields at all, only the default profiles selected for the main participants in the Online Registration settings.  What am I missing?  How do I make the role-specific form display only the role-specific profile?  
  > **username_0**: I should add that the role-specific profiles appear in the backend, but not in the frontend registration form.  
  
  ---
  
  