Ask your WordPress questions! Pay money and get answers fast! (more info)

Contact Form 7 + Wysija WordPress

  • SOLVED

Hi,

I'm rookie in PHP and in writing code and I need to add the user, email and birthdate on Wysija (Mailpoet) from my Contact Form 7 form.

Wysija has this instructions:
http://support.wysija.com/knowledgebase/plugin-form-integrate/

And there´s this post in blog:
http://wpquestions.com/question/showChrono/id/8262

But Contact Form 7 has changed the code:
http://contactform7.com/2014/07/02/contact-form-7-39-beta/

I also want to show the my public newsletter lists in my Contact Form 7 form to the subscribers select the wanted lists.


Contact Form Name - 'Newsletter'

Fields in the form:

[text* your-name]
[email* your-email]
[date* your-birthdate]

Can you help me?

Thanks! :)
Miguel

Answers (1)

2014-12-13

Francisco Javier Carazo Gil answers:

Why don't you use a form directly from MailPoet - Wysija?


miguelamendes9 comments:

Because the date field i can't put the date field a required field.


Francisco Javier Carazo Gil comments:

Ok, but with some JS code you can do it.


miguelamendes9 comments:

Can you show me how?

The date field in Mailpoet has a pre-select date, is not a blank field.


Francisco Javier Carazo Gil comments:

Show me a URL, the field and I tell you.


miguelamendes9 comments:

http://www.purposeandpath.com/newsletter/


Francisco Javier Carazo Gil comments:

Insert this JS in this page:

<script>
var current_year = new Date().getFullYear();

jQuery(document).ready(function($){

$("#form-wysija-shortcode548c96005bb1a-2").submit(function(){
if($("#form-wysija-shortcode548c96005bb1a-2 > p.wysija-paragraph.wysija-date > select.wysija_date_day").val() == "1" &&
$("#form-wysija-shortcode548c96005bb1a-2 > p.wysija-paragraph.wysija-date > select.wysija_date_month").val() == "January" &&
$("#form-wysija-shortcode548c96005bb1a-2 > p.wysija-paragraph.wysija-date > select.wysija_date_year").val() == current_year
)
{
alert("You should choose your birthdate");
return false;
}

});

});

</script>


miguelamendes9 comments:

I insert the JS in this page - http://www.purposeandpath.com/newsletter/?


miguelamendes9 comments:

I inserted the JS code in the page but didn't work out. I could subscribe without changing the date.


Francisco Javier Carazo Gil comments:

Send me FTP credentials via PM and I insert it in a moment (you should know how to insert JS in WordPress theme for example).


miguelamendes9 comments:

I have already inserted the JS code but didn't work out.


Francisco Javier Carazo Gil comments:

How have you inserted it? I would need to see if there is some syntax o lex error there (if I cannot test, I am not sure).


miguelamendes9 comments:

I have the Divi Theme (http://www.elegantthemes.com/gallery/divi/) and it has a Page Builder and i put i the "Text" part. There were i put code and shortcodes in the Page Builder. See the JPG.