Contact Form 7
Display name in thank you message? (7 posts)

  1. clevestam
    Posted 5 years ago #

    I have a client that want the name from the form to be displayed in the thank you message once they have filled in the form and submitted.

    How do i accomplish this?

  2. clevestam
    Posted 5 years ago #

    no edit button??

    How about getting the shortcode to work with the "messages"?
    [your-name] etc.?

  3. webjunk
    Posted 5 years ago #

    When you view the Contact Form you can edit it then click on Save at the bottom.
    When viewing the Contact form, look near the bottom and click on the Bold Messages. You can edit the Thank You message

  4. clevestam
    Posted 5 years ago #

    I know i can edit the thank you message that way, but i cant make it display the name from the input field in the message. i want the " $POST_your-name " to display.

    it just converts the shortcode to string instead of parsing it.
    im digging through the php and js files. But im just not that good at reading these script languages yet :)

  5. clevestam
    Posted 5 years ago #

    If someone could point me to the right function to modify, and what to add, I would really appreciate it.

  6. clevestam
    Posted 5 years ago #

    ...silent as the grave..... let me ask this then: Can i modify the ajax message with the JS action hook in the additional settings?

    on_sent_ok: (code);

    anyone kind enough to provide a code snippet?? :)

  7. clevestam
    Posted 5 years ago #

    If anyone is interested this is what i did to make it work, considering im a total noob with ajax, jquery and javascript in general i think i did pretty goood. The edited file is scripts.js.

    success: function(data) {
    					var ro = $(data.into).find('div.wpcf7-response-output');
    					var x=0;
    					if (data.invalids) {
    						$.each(data.invalids, function(i, n) {
    					if (data.captcha)
    					if (data.quiz)
    					if (1 == data.spam)
    					if (1 == data.mailSent) {
    						var x=1;
    						var namnet = $('[name=your-name]').val();
    						if (data.onSentOk)
    							$.each(data.onSentOk, function(i, n) { eval(n) });
    					} else {
    					if (data.onSubmit)
    						$.each(data.onSubmit, function(i, n) { eval(n) });
    					$(data.into).find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
    					if (x>0) {
    						ro.append('Tack ',namnet,' för ditt medelande vi hör av oss så fort vi kan.').fadeIn(1000).delay(4000).fadeOut(3000);

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic