Answers.Body: <p>If you use Drupal's webform (with webform civicrm to integrate civicrm), you can use the "webform conditionals" function.</p>
  
  <p>Alternatively, you could create some custom javascript for the form.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-03T19:22:06.040Z
Answers.Text: Thanks Alan. I am familiar with webform conditionals but can't think of a way to use them in this case. The CIVI tab in the integrated webform offers the option to filter the list of School contacts by a tag, but as far as I can tell that's a static filter. Is there a way to interact with that filter from webform conditionals? Or did you have something else in mind altogether?
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-03T19:41:34.077Z
Answers.Text: Correction, the Filters feature is in the webform element itself, not in the CIVI tab. The issue still is that I don't know how to interact with that Tags filter via conditionals. If you were thinking of another approach altogether, I'm all ears!
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-04T23:54:31.350Z
Answers.Text: Got it to work with conditionals. The trick was to have separate contacts in the CIVICRM tab of the webform, one for each of Elementary, Middle, and High school. The conditionals just make sure that only the webform element linked (and filtered) to the grade-appropriate schools is shown. Cumbersome and maybe not broadly applicable, but it's the only way I could get it to work.  Thanks!
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-05T15:17:39.033Z
Answers.Text: Well done! Conditionals are hard to maintain when they get complicated, but unless you want to maintain custom code, it's often the only option for site-builders.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-02T21:53:34.260Z
Answers.LastActivityDate: 2019-12-06T19:24:41.700Z
Answers.LastEditDate: 2019-12-06T19:24:41.700Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>If you have Drupal, I highly recommend Alan's answer.
  If you are a WordPress user, there is a Gravity forms CiviCRM integration. I know that Gravity forms can do the conditional show/hide like Webform can. I do not have experience on the CiviCRM integration.</p>
  
  <p>Another option is to have the initial page with buttons for Elementary, Middle &amp; High Schools. Once they select that, they can see the form for that range with just their list of schools available in the dropdown. Not as slick as the conditional function but very doable.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-03T20:14:38.327Z
Answers.Text: I asked Alan for his thoughts on how to do this w. conditionals. That'd be my preferred approach, just can't think how to make it work. Re. an initial page w. multiple buttons, what would be the mechanics? Feels like I'd need to either 1) jump to a subsequent page break in the form based on the selection, but the page break element in webform allows only one "next" - or 2) redirect to another form, but that'd require multiple submit buttons and I don't know how to do that. Thank you for bearing w. me!
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-04T03:06:19.553Z
Answers.Text: I think your asking how to make conditionals work... On your form, 1st question is Grade. Then make 3 Questions for School each with a specific dropdown list by grade group. Then under conditionals, show School Elementary if question 1 fits that, show School Middle if question 1 fits that, etc. You can even show other questions based on grade range as well.
Answers.UserDisplayName: Iowa Boy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-04T03:14:10.603Z
Answers.Text: To do the multi button option, you would build 3 completely separate forms, one for elementary, one middle, and High School. Then you would have an initial page that would have the buttons to direct them to the correct form.  Again, the conditionals that Alan suggested is your best option.
Answers.UserDisplayName: Iowa Boy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-05T00:02:02.257Z
Answers.Text: I translated the "three questions" into three separate contacts in the CIVICRM tab of the webform. That made it work with conditionals. If you meant something simpler, I'm all ears!
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-02T23:25:58.907Z
Answers.LastActivityDate: 2019-12-04T03:23:53.970Z
Answers.LastEditDate: 2019-12-04T03:23:53.970Z
Answers.UserDisplayName: Iowa Boy
Answers.Body: <p>For WordPress I think there is more integration/options with Caldera Forms</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-03T02:56:10.230Z
Answers.LastActivityDate: 2019-12-03T02:56:10.230Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>We work with schoolchildren in Florida, US. Schooling here is grouped into Elementary (grades 1 thru 5), Middle (grades 6 thru 8) and High School (grades 9 thru 12). I have a webform that asks the grade and the school, where school is a dropdown with too many choices. Is there a way to limit the choices in the school dropdown to those that offer the grade entered?</p>
  
  <p>School facilities in our CiviCRM are Organization contacts with tag(s) indicating the grade grouping(s) each serves. Most school facilities serve only one grouping, but some serve all groupings (Elementary, Middle and High).</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-03T19:23:17.057Z
Comments.Text: Clarifying that the CMS is Drupal 7.
Comments.UserDisplayName: wil_SRQ
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-04T03:37:36.073Z
Comments.Text: would it help if you used Parent Tags (as I recall doing some nifty filtering in the past in webforms for Tags based around setting the Parent Tag rather than the tag itself - forget the detail so may not be relevant)
Comments.UserDisplayName: petednz - fuzion
Tags: <webform-civicrm>
Title: Filter options dynamically in webform
ThreadText: # Filter options dynamically in webform
  
  (Asked by: username_0 on 2019-12-02)
  
  We work with schoolchildren in Florida, US. Schooling here is grouped into Elementary (grades 1 thru 5), Middle (grades 6 thru 8) and High School (grades 9 thru 12). I have a webform that asks the grade and the school, where school is a dropdown with too many choices. Is there a way to limit the choices in the school dropdown to those that offer the grade entered?
  
  School facilities in our CiviCRM are Organization contacts with tag(s) indicating the grade grouping(s) each serves. Most school facilities serve only one grouping, but some serve all groupings (Elementary, Middle and High).
  
  **Tags:** webform-civicrm
  
  > **Comments:**
  > **username_0**: Clarifying that the CMS is Drupal 7.  
  > **username_1**: would it help if you used Parent Tags (as I recall doing some nifty filtering in the past in webforms for Tags based around setting the Parent Tag rather than the tag itself - forget the detail so may not be relevant)  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2019-12-02. Score: 4 | Accepted answer
  
  If you use Drupal's webform (with webform civicrm to integrate civicrm), you can use the "webform conditionals" function.
  
  Alternatively, you could create some custom javascript for the form.
  
  > **Comments:**
  > **username_0**: Thanks Alan. I am familiar with webform conditionals but can't think of a way to use them in this case. The CIVI tab in the integrated webform offers the option to filter the list of School contacts by a tag, but as far as I can tell that's a static filter. Is there a way to interact with that filter from webform conditionals? Or did you have something else in mind altogether?  
  > **username_0**: Correction, the Filters feature is in the webform element itself, not in the CIVI tab. The issue still is that I don't know how to interact with that Tags filter via conditionals. If you were thinking of another approach altogether, I'm all ears!  
  > **username_0**: Got it to work with conditionals. The trick was to have separate contacts in the CIVICRM tab of the webform, one for each of Elementary, Middle, and High school. The conditionals just make sure that only the webform element linked (and filtered) to the grade-appropriate schools is shown. Cumbersome and maybe not broadly applicable, but it's the only way I could get it to work.  Thanks!  
  > **username_2**: Well done! Conditionals are hard to maintain when they get complicated, but unless you want to maintain custom code, it's often the only option for site-builders.  
  
  ---
  
  ### Answer by username_3 on 2019-12-02. Score: 3
  
  If you have Drupal, I highly recommend Alan's answer.
  If you are a WordPress user, there is a Gravity forms CiviCRM integration. I know that Gravity forms can do the conditional show/hide like Webform can. I do not have experience on the CiviCRM integration.
  
  Another option is to have the initial page with buttons for Elementary, Middle & High Schools. Once they select that, they can see the form for that range with just their list of schools available in the dropdown. Not as slick as the conditional function but very doable.
  
  > **Comments:**
  > **username_0**: I asked Alan for his thoughts on how to do this w. conditionals. That'd be my preferred approach, just can't think how to make it work. Re. an initial page w. multiple buttons, what would be the mechanics? Feels like I'd need to either 1) jump to a subsequent page break in the form based on the selection, but the page break element in webform allows only one "next" - or 2) redirect to another form, but that'd require multiple submit buttons and I don't know how to do that. Thank you for bearing w. me!  
  > **username_3**: I think your asking how to make conditionals work... On your form, 1st question is Grade. Then make 3 Questions for School each with a specific dropdown list by grade group. Then under conditionals, show School Elementary if question 1 fits that, show School Middle if question 1 fits that, etc. You can even show other questions based on grade range as well.  
  > **username_3**: To do the multi button option, you would build 3 completely separate forms, one for elementary, one middle, and High School. Then you would have an initial page that would have the buttons to direct them to the correct form.  Again, the conditionals that Alan suggested is your best option.  
  > **username_0**: I translated the "three questions" into three separate contacts in the CIVICRM tab of the webform. That made it work with conditionals. If you meant something simpler, I'm all ears!  
  
  ---
  
  ### Answer by username_1 on 2019-12-03. Score: 0
  
  For WordPress I think there is more integration/options with Caldera Forms
  
  
  ---
  
  