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 Confirmation message based on Drop Down Selection AND time/day?

  1. First, is it possible to return a series of various confirmation messages, enable/disable confirmation emails with different messages in the emails based on a selection from a dropdown?

    For ex.
    If the user chooses:
    "drop down option 1" - the form returns "Custom Confirmation message" (with no email confirmatin sent)
    OR
    "drop down 2" - the form returns "Custom Confirmation message " (WITH email confirmatin sent)

    AND FINALLY, is it possible to send/show another custom confirmation message if the user submits the form during certain days and hours of the day? Specifically "9:45AM-10:45PM on Monday thru Friday"

    I know achieving all of the above is a tall order but even to achieve some of it would be greatly appreciated. Any help, guidance or suggestions are welcomed.

    thanks!

    Posted 12 years ago on Sunday October 28, 2012 | Permalink
  2. Yes. You can use show conditional confirmation messages. In your text confirmation area, wrap each separate message in a conditional shortcode, based on the selection from your dropdown. Documentation here:

    http://www.gravityhelp.com/documentation/page/Shortcodes#Conditional_Shortcode

    To show a confirmation based on the time of day will require some custom code. Either setting a hidden value in the form before it's rendered, then based on that value, show a conditional message, or, after the form is submitted, display your message based on the current time. Either of these solutions will require some PHP to compare the time of day to your target time, then change the message based on that time. It can be done.

    Posted 12 years ago on Monday October 29, 2012 | Permalink
  3. Thanks for the guidance Chris, much appreciated. That shortcode conditional function is amazing, had no idea about it. That will certainly take care of 99% of my concern.

    For the time and day portion.. I'm sure I could find some php date/time conditionals to wrap a custom response. My follow up question would be, where in my template file or in the backend could I add this code? For example, lets say I did use a hidden field and wrapped that in this day/time conditional and based on its presence I sent the additional notification message? Where could I put
    "if (is DAY/TIME()) {
    hidden field
    }"

    thanks for the info!

    Posted 12 years ago on Monday October 29, 2012 | Permalink
  4. Any custom PHP functions you write will be added to your theme's functions.php:
    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    The code will be in a function in your theme's functions.php and you will call your code using one of the hooks or filters which are built in to Gravity Forms. You could use gform_pre_render to add the hidden fields before the form is submitted or gform_confirmation to change the message conditionally based on the time of day the form is submitted. It just depends on how you want to approach it.

    Posted 12 years ago on Monday October 29, 2012 | Permalink
  5. awesome, thanks Chris. I'm sure I can google around enough and get this accomplished. More of s designer then a developer but certainly not afraid to try!
    thanks again!

    Posted 12 years ago on Tuesday October 30, 2012 | Permalink
  6. Sorry Chris, one more thing if you wouldn't mind.
    I tried the conditional :

    [gravityforms action="conditional" merge_tag="{Choose one of the options below to open your application::17}" condition="is" value="immediately"]<p><strong>A Pardon & Waiver Officer will contact you urgently to confirm your eligibility and open your application.</strong></p>

    I put this in the confirmation field in the form settings. My "label" and "value" are different but I am checking the radio button selection value of "immediately" but the text confirmation message above is not showing up as expected.

    Do you see anything off in the statement by chance?

    Posted 12 years ago on Tuesday October 30, 2012 | Permalink
  7. Try this as your merge tag:

    merge_tag="{Choose one of the options below to open your application::17:value}"

    Other than that suggestion, I'd have to see the form and the conditional both to see why this is not working as expected.

    Sometimes, for testing, you can try the opposite, to see if the text will at least show up at all. In that case, you could try "isnot" instead of "is" and see if you get the text. If you do, then the correct field is being checked and the conditional statement is formatted correctly, but there is something different about the value or label so the match is not exact.

    Posted 12 years ago on Wednesday October 31, 2012 | Permalink
  8. Hey Chris, thanks for the reply. I got it to work using the "label" contents opposed to the "value" (which was different). I also had some <span> tags in the label as well which I removed and got it to return a result. I'm sure the spans and/or the combination of not using the values from the "label" had something to do with it.

    thanks!

    Posted 12 years ago on Wednesday October 31, 2012 | Permalink
  9. You're welcome. Thanks for the update. If you were using HTML in the labels that would affect it as well, as you found out.

    Posted 12 years ago on Wednesday October 31, 2012 | Permalink

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