Answers.Body: <p>You can use jQuery in the webform to hide/display the checkboxes based on the contents of the membership id box.  A simple implementation could just check whether the membership box is blank, but then any random stuff would show the member options.  A next step would check the membership id is of the right format.  Even better would be using the API to check the validity of the id entered.</p>
  
  <p>That will let you display what you want but does not prevent a determined user displaying the hidden options so you should probably add a validation rule as well.</p>
  
  <p>Also, if the person filling out the form is an existing contact, you could use the auto-populate feature for existing contacts to get the webform to display the membership number directly.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-07T13:00:17.930Z
Answers.Text: I'm curious why this got down voted?  Having access to jquery during all of this would be great!  I didn't even know you could do that and I must know how to do that!  Thanks!
Answers.UserDisplayName: njDeveloper
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T09:14:35.663Z
Answers.Text: I'd like to know too - seems bad practice to down vote without explaining why.  But I can tell you it works!   You can put your script in a Markup component or add it to the theme see https://www.drupal.org/node/342183 in Drupal's Site Building Guide.
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-06T12:24:20.500Z
Answers.Text: Agree - I'm voting it up!
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-07T09:11:50.697Z
Answers.LastActivityDate: 2016-03-07T09:11:50.697Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>Definitely time to use the Webform Conditionals here - I think it's in Webform but it may be a separate module. Google for a tutorial :)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-07T09:48:09.180Z
Answers.Text: "As of Webform version 7.x-4.0-alpha2 this module has been merged into Webform and is no longer necessary." - https://www.drupal.org/project/webform_conditional
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-07T12:59:08.790Z
Answers.Text: Webforms allows for conditionals true, but it only allows disabling the whole control which in this case is the group of checkboxes.  Thanks for the reply!
Answers.UserDisplayName: njDeveloper
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-07T09:32:57.043Z
Answers.LastActivityDate: 2016-03-07T09:32:57.043Z
Answers.UserDisplayName: JohnFF
Body: <p>I have the webform module installed on Drupal 7.41 with CiviCRM 4.7.2.  I'd like to make an event registration form.  This event spans a few days.  If the person filling out the form has an organization membership id, they need to be able to enter that, and membership options need to be enabled for the days they wish to attend.</p>
  
  <p>For example.  The event is Monday and Tuesday.  There is also an "All Days" option.  There will be a Member option for each day, a normal price for each day and a retire price for each day.  Above the checkboxes there will be a text box where they can enter their membership ID.  If that text box is empty I want to disable the membership options.  Currently I can only disable to whole checkbox group.</p>
  
  <p>In addition, if any of the All boxes are checked, the remaining boxes need to be disabled.</p>
  
  <p>Thoughts on how I could do this?  Thanks!!</p>
  
Tags: <civievent><webform-civicrm>
Title: How to disable one checkbox in a group based on text box having value
ThreadText: # How to disable one checkbox in a group based on text box having value
  
  (Asked by: username_0 on 2016-03-04)
  
  I have the webform module installed on Drupal 7.41 with CiviCRM 4.7.2. I'd like to make an event registration form. This event spans a few days. If the person filling out the form has an organization membership id, they need to be able to enter that, and membership options need to be enabled for the days they wish to attend.
  
  For example. The event is Monday and Tuesday. There is also an "All Days" option. There will be a Member option for each day, a normal price for each day and a retire price for each day. Above the checkboxes there will be a text box where they can enter their membership ID. If that text box is empty I want to disable the membership options. Currently I can only disable to whole checkbox group.
  
  In addition, if any of the All boxes are checked, the remaining boxes need to be disabled.
  
  Thoughts on how I could do this? Thanks!!
  
  **Tags:** civievent, webform-civicrm
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-03-07. Score: 3
  
  You can use jQuery in the webform to hide/display the checkboxes based on the contents of the membership id box. A simple implementation could just check whether the membership box is blank, but then any random stuff would show the member options. A next step would check the membership id is of the right format. Even better would be using the API to check the validity of the id entered.
  
  That will let you display what you want but does not prevent a determined user displaying the hidden options so you should probably add a validation rule as well.
  
  Also, if the person filling out the form is an existing contact, you could use the auto-populate feature for existing contacts to get the webform to display the membership number directly.
  
  > **Comments:**
  > **username_0**: I'm curious why this got down voted?  Having access to jquery during all of this would be great!  I didn't even know you could do that and I must know how to do that!  Thanks!  
  > **username_1**: I'd like to know too - seems bad practice to down vote without explaining why.  But I can tell you it works!   You can put your script in a Markup component or add it to the theme see https://www.drupal.org/node/342183 in Drupal's Site Building Guide.  
  > **username_2**: Agree - I'm voting it up!  
  
  ---
  
  ### Answer by username_3 on 2016-03-07. Score: 0
  
  Definitely time to use the Webform Conditionals here - I think it's in Webform but it may be a separate module. Google for a tutorial :)
  
  > **Comments:**
  > **username_1**: "As of Webform version 7.x-4.0-alpha2 this module has been merged into Webform and is no longer necessary." - https://www.drupal.org/project/webform_conditional  
  > **username_0**: Webforms allows for conditionals true, but it only allows disabling the whole control which in this case is the group of checkboxes.  Thanks for the reply!  
  
  ---
  
  