MailChimp Integration only if radio button is checked

Home Forums Quform WordPress MailChimp Integration only if radio button is checked

This topic is: resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23331
    thibautnorga
    Participant

    Hi,

    I followed the MailChimp integration set-up and that works splendid.

    But with the new GDPR data law I need to change our form a bit. We need to have an unchecked button they need to check it if they want to get a newsletter. So, I need to add an ‘if’ function in the code.

    I thought it was easy and just added the following, but that doesn’t work

    if ($form->getValue(‘quform_1_31’)==1){
    $api = new MCAPI(‘api_key’);
    $listId = ‘list_ID’;
    $email = $form->getValue(‘quform_1_18’);
    $mergeVars = array(
    ‘FNAME’ => $form->getValue(‘quform_1_4’),
    ….

    That if value doesn’t work.

    It’s a radio button I use in the form.

    Which value do I need to write so this works?

    #23335
    thibautnorga
    Participant

    SOLVED

    #24228
    rnipper
    Participant

    What did you do to solve it?

    #24229
    thibautnorga
    Participant

    The value for a checked button is ’11’ and not ‘1’, so

    
    if ($form->getValue(‘quform_x_xx’)==11){
    
    • This reply was modified 7 years, 7 months ago by thibautnorga.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy