PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Conditional Formatting - Change dropdown option when total enrolled exceeds #

  1. Hi - I'm ready to code this feature.

    Here are the fields:

    Choose a class:
    Class A
    Class B

    How many students are you enrolling: #number

    What I need to do it keep a running tally of how many students have signed up for Class A and how many have signed up for Class B. Once a class enrollment has exceeded 100 then I needed to hide the Class A (or ) option and begin displaying the option Class A Waitlist (or Class B Waitlist)

    http://pastebin.com/ZMNAJkBS

    Posted 8 years ago on Monday December 5, 2011 | Permalink
  2. If I have to I could consider doing an approach where I list each option where it says:

    Class A: Number attending _________ (display if Class A < 100)
    Class A Wait List: Number attending _________ (display if Class A >= 100)
    Class B: Number attending _________ (display if Class B < 100)
    Class B Wait List: Number attending _________ (display if Class B >= 100)

    This way I could check the database for the value of Class A and Class B separately and choose whether to display Class A or Class A Wait List

    I've see some examples around the forum. Looks like I'd need a function.php function added. Could you give me an example and share how I use it on the form

    Thanks

    Posted 8 years ago on Tuesday December 6, 2011 | Permalink
  3. Hello? I need some help on this one

    Posted 8 years ago on Thursday December 8, 2011 | Permalink
  4. Hi Mozak,

    Sorry we missed your earlier posts. I'm just closing up shop now but I've marked this topic and will help you figure this out first thing tomorrow. :)

    Posted 8 years ago on Friday December 9, 2011 | Permalink
  5. Hi Jocelyn, does this post by David Smith help point you in the right direction?

    http://www.gravityhelp.com/forums/topic/counting-responses#post-43591

    Posted 8 years ago on Saturday December 10, 2011 | Permalink
  6. I also need to be able to query the database to see how many people have signed up thus far.

    I would either need to sum all entries each time the form runs or find a way to add a field that I query the database and update each time the form is submitted.

    So I'd need php function to do:

    if (total-ClassA-registered > 100) {display ClassA option; add number being registered to total-ClassA-registered when the form is submitted} else {display ClassA-Waitlist}

    Please let me know if I should upgrade to a Developer to get help on this one

    Posted 8 years ago on Sunday December 11, 2011 | Permalink
  7. No need to upgrade to a Developer License, unless you would like access to Priority Support or additional add-ons.

    I will take a look at this for you this weekend and post something on or before Monday. Thanks.

    Posted 8 years ago on Sunday December 11, 2011 | Permalink
  8. I just decided to upgrade. I could use the priority support and I could easily see myself using it on more than 3 sites this year :)

    Posted 8 years ago on Sunday December 11, 2011 | Permalink
  9. OK great. Thank you for upgrading. Have you emailed this request to Priority Support or would you like me to continue working on it here? I don't want to duplicate effort if you have also emailed Priority Support.

    Posted 8 years ago on Monday December 12, 2011 | Permalink
  10. No I have not emailed it to priority support - let me know if I should. I do have a deadline w/a client on this one

    Posted 8 years ago on Monday December 12, 2011 | Permalink
  11. Let me know your deadline Jocelyn. Carl Hancock is travelling and normally handles priority support. Response time may be a little longer, so if we have time, I'd like to handle this here.

    Posted 8 years ago on Monday December 12, 2011 | Permalink
  12. I'd like to get the code working by Wednesday. This is my first time writing custom code to interface w/gravity forms so I might need it spelled out a bit. That said ... I love writing custom shortcodes so I am not new to the functions.php file.

    Posted 8 years ago on Monday December 12, 2011 | Permalink
  13. Very good. Look for an answer from me on Monday. Thanks Jocelyn.

    Posted 8 years ago on Monday December 12, 2011 | Permalink
  14. Hi - I'm getting nervous. I put up this post over a week ago after being told that I would get support on this project once I bought the plugin. I need to have this done by tomorrow which means I should be testing things today. I know you are doing your best ... but what should I do?

    Posted 8 years ago on Tuesday December 13, 2011 | Permalink
  15. David Smith and I have talked about this and he has some code ready for you. Here it is. I asked him to post here with a full explanation but wanted you to have this now so you can start testing. Please let us know if you have any specific questions.

    Here is how I have the field setup:
    http://grab.by/boEW

    And here is the code:
    http://pastie.org/3012136

    Posted 8 years ago on Tuesday December 13, 2011 | Permalink
  16. Thank you so much. I'll start playing with it.

    What beautiful code!

    Posted 8 years ago on Tuesday December 13, 2011 | Permalink
  17. When I add that code to my functions.php I get the error:Oops! We could not locate your form.

    When I remove it the form displays

    http://pastie.org/pastes/3013128

    Posted 8 years ago on Tuesday December 13, 2011 | Permalink
  18. Hi Jocelyn,

    Any chance I could get a WP login and FTP access to take a look? Send to david@rocketgenius.com.

    Posted 8 years ago on Wednesday December 14, 2011 | Permalink
  19. I wonder if I need to first fill out the form w/o this logic to initiate the database?

    Another issue: Field #25 holds the number of students registered each time the form is submitted.
    So in the loop it is not ++ but instead needs to be += field #25

    Posted 8 years ago on Wednesday December 14, 2011 | Permalink
  20. Jocelyn, was David able to help you with your code?

    Posted 8 years ago on Thursday December 15, 2011 | Permalink

This topic has been resolved and has been closed to new replies.