Navigation überspringen

[Gelöst] Toolset form – multiple thank you messages

This support ticket is created vor 2 Jahre, 2 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 2 Jahre, 2 Monaten.

Assistiert von: Minesh.

Author
Artikel
#2571911

Hey is there a way to add a different thank you messages based on what the user filled on the specific dropdown option?

#2572019

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - it could be possible but you will have to write custom shortcode in order to build custom thank you message based on the selected option.

For example:
You can add the following custom shortcode to "Custom Code" section offered by Toolset:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset


function func_show_different_thank_you_message() { 
 global $post;
 
$target_field = "book";
 $val = get_post_meta($post->ID,'wpcf-'.$target_field ,true);
 $msg = '';
 if($val == 1) {
   $msg = "Thank you for selecting the option  1";
 }else if($val == 2) {
   $msg = "Thank you for selecting the option  2";
 }
  
return $msg;
}
add_shortcode('show_thankyou_msg', 'func_show_different_thank_you_message');

Where:
- Replace $target_field with your original select field slug
- You and adjust the code as required.

And with your form's "Display a message instead of form" editor add the shortcode:

[show_thankyou_msg]