• Resolved pkon

    (@pkonings)


    Hello,

    I am using CF7 and I tried several different things to get it to work as intended.
    I am also using conditional fields.

    I have a really long form with several conditions in there, right now if people select a condition it means 33% of the form will show up, 66% stays hidden.

    However, in the PDF right now it’s like this:

    Name: [your-name]

    This means if someone would not fill in the field, in the PDF it will still say

    Name:

    I am trying to make it so if someone leaves a field empty, it does not just remove the [your-name] but also the text before it in the PDF that indicates what the question was.

    I have tried:
    – Not using a placeholder, instead use the <label> element and normal text inside the label.
    – Using the <Label for= method

    There seems to be no way to output the entire <label>…</label> into the PDF

    This would be very handy since then if the field is left empty and it’s excluded from the output, it exludes the entire label including the part that says ‘Name:’.

    And this way you are not left with a PDF that is filled with empty fields that were hidden under the conditional fields.

    Does anyone have a suggestion on how to make this work?
    Making all the fields mandatory is not an option, they are not able to fill out the fields hidden under the non-selected conditions.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author ZealousWeb

    (@zealopensource)

    Hello @pkonings,

    Thank you so much for reaching me. I would like to request a modification in the following file:
    File Path: wp-content/plugins/generate-pdf-using-contact-form-7/inc/front
    File Name: class.cf7-pdf-generation.front.action.php
    The changes needed are as follows:
    Before Code:

    $msg_body = str_replace('['.$key.']','[noreplace]',$msg_body);

    After Code:

    $msg_body = str_replace('['.$key.']',' ',$msg_body);

    This adjustment is essential for our system’s functionality. I have also attached a screenshot for your reference:
    SS : https://prnt.sc/IGloK3WbTG_-

    OUTPUT

    If you have any questions or require further clarification, please don’t hesitate to reach out.

    Thank you,
    ZealousWeb

    Thread Starter pkon

    (@pkonings)

    Hello ZealousWeb,

    Thank you for your response, I think we miscommunicated.. The suggested edit to the php file does not really provide anything.

    I made this image to give clarification as to what I am trying to reach:
    https://ibb.co/vVt1mxy

    Plugin Author ZealousWeb

    (@zealopensource)

    Dear @pkonings,

    Kindly incorporate it using a straightforward <b> tag, as illustrated in the attached image.

    Displaying the output similar to the example provided.

    Thank you,
    ZealousWeb

    Thread Starter pkon

    (@pkonings)

    Hello ZealousWeb,

    In this case, if user does not fill out Name the output will be:

    Your name:

    My goal is to have instead an empty line.

    Plugin Author ZealousWeb

    (@zealopensource)

    Dear?@pkonings,

    It will not generate any output. you need to output please change code.

    File Path: wp-content/plugins/generate-pdf-using-contact-form-7/inc/front
    File Name: class.cf7-pdf-generation.front.action.php

    The changes needed are as follows:
    Before Code:

    $msg_body = str_replace('['.$key.']','[noreplace]',$msg_body);
    

    After Code:

    $msg_body = str_replace('['.$key.']',' ',$msg_body);
    Plugin Author ZealousWeb

    (@zealopensource)

    Dear?@pkonings,

    Alter the code present in line 271.

    Thank you,
    ZealousWeb

    Plugin Author ZealousWeb

    (@zealopensource)

    Dear @pkonings,

    Everything is going well here.

    If you have any questions, please don’t hesitate to ask—I’m here to assist.

    Thank you,
    ZealousWeb

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘IS it possible to output complete label?’ is closed to new replies.