• Resolved areinheimer

    (@areinheimer)


    Hi, great plugin!
    I am trying to place some text in a pdf which is conditional on what the user selects on the front end, without having the user actually select the text. To do this I am using your plugin along with two others: Contact Form 7 – Dynamic Text Extension and Contact Form 7 Conditional Fields Pro. The trouble is that although the text is printed correctly on the screen, only the second instance of the dynamic field is printed on the pdf.

    Here is the form code… Once it’s working I will hide the dynamic text.

    [select menu-280 “a” “b”]
    [group a_selected]
    [dynamictext dynamictext-251 “a was selected”]
    [/group]
    [group b_selected]
    [dynamictext dynamictext-251 “b was selected”]
    [/group]
    [submit “Send mail”]

    On the screen “a was selected” and “b was selected” toggle back and forth as the selection is changed but the pdf only prints “b was selected”.

    It seems like this should be an easy thing, but I can’t seem to figure it out! Thanks for any help you can provide.

    • This topic was modified 5 years, 6 months ago by areinheimer.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • dynamictext-251 name is same for both fields. Maybe this is your issue?

    I’m using embedded to form jQuery script for that problem.
    hidden field + jQuery, hooked to source control change event, mirroring selected value to hidden field.

    My problem: user can select value from predefined list, or select ‘Other’ and input his own value in appeared field

    
    let autopumpLengthPhy = jQuery("select[name='autopump-length-phy']");
        let autopumpLengthValuePhy = jQuery("input[name='autopump-length-value-phy']");
        autopumpLengthPhy.change(function() {
    
          if (this.value == "22 м") {
            autopumpLengthValuePhy.val("22");
            return;
          }
    
          if (this.value == "41 м") {
            autopumpLengthValuePhy.val("41");
            return;
          }
    
          if (this.value == "Other") {
            autopumpLengthValuePhy.val("");
            return;
          }
        });
    
    Thread Starter areinheimer

    (@areinheimer)

    That looks like it would do the trick. Where did you put this bit of code and how did you call it? (Sorry, I’m a newbie with embedded jQuery).

    Plugin Author maximum.software

    (@maximumsoftware)

    There are a few methods. You can use a plugin like Code Embed.

    you can paste any html code directly to CF7 form building area
    here is ending of my form:

    
     <div class="grid__col grid__col--3-of-12">
        [md-text label="Число перестановок:"]
        [number autopump-moving-count-phy min:0]
        [/md-text]
      </div>
      <script type="text/javascript">
        let autopumpLengthPhy = jQuery("select[name='autopump-length-phy']");
        let autopumpLengthValuePhy = jQuery("input[name='autopump-length-value-phy']");
        autopumpLengthPhy.change(function() {
    
          if (this.value == "22 м") {
            autopumpLengthValuePhy.val("22");
            return;
          }
    
          if (this.value == "41 м") {
            autopumpLengthValuePhy.val("41");
            return;
          }
    
          if (this.value == "Другая") {
            autopumpLengthValuePhy.val("");
            return;
          }
        });
      </script>
      [/group]
      <div class="grid__col grid__col--2-of-12">
        [md-submit]
        [submit "Отправить"]
        [/md-submit]
      </div>
    </div>
    [dynamichidden order-date-phy "timestamp type='d.m.Y'"]
    [/md-form]
    
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dynamic data not filling properly in pdf’ is closed to new replies.