Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Display name in thank you message?

  • 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?

Viewing 6 replies - 1 through 6 (of 6 total)
  • no edit button??

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

    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

    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 🙂

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

    …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?? 🙂

    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;
    
    					$(data.into).wpcf7ClearResponseOutput();
    
    					if (data.invalids) {
    						$.each(data.invalids, function(i, n) {
    							$(data.into).find(n.into).wpcf7NotValidTip(n.message);
    						});
    						ro.addClass('wpcf7-validation-errors');
    					}
    
    					if (data.captcha)
    						$(data.into).wpcf7RefillCaptcha(data.captcha);
    
    					if (data.quiz)
    						$(data.into).wpcf7RefillQuiz(data.quiz);
    
    					if (1 == data.spam)
    						ro.addClass('wpcf7-spam-blocked');
    
    					if (1 == data.mailSent) {
    						var x=1;
    						var namnet = $('[name=your-name]').val();
    						$(data.into).find('form').resetForm().clearForm();
    						ro.addClass('wpcf7-mail-sent-ok');
    
    						if (data.onSentOk)
    							$.each(data.onSentOk, function(i, n) { eval(n) });
    					} else {
    						ro.addClass('wpcf7-mail-sent-ng');
    					}
    
    					if (data.onSubmit)
    						$.each(data.onSubmit, function(i, n) { eval(n) });
    
    					$(data.into).find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
    						$(n).val($(n).attr('title'));
    					});
    
    					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);
    						x=0;
    					}else{
    						ro.append(data.message).fadeIn(1000).delay(4000).fadeOut(3000);
    					}
    
    				}
    			});
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Contact Form 7] Display name in thank you message?’ is closed to new replies.