[e2pdf-if-condition]

Formidable Forms
8 February, 2025 18:23:53
recuniforms
Topics: 8
Messages: 47
I'm trying to display a cell only if a condition is met. I've tried both [==] and [contains]. The trouble I'm having is that [==] is failing to recognize the condition and [contains] always recognizes the condition. Here are the two pieces of code I've tried:

[e2pdf-if][e2pdf-if-condition][304][==]Travel Set (Jersey x 2, Shorts & Socks)[/e2pdf-if-condition][e2pdf-if-do]<td width="50"><p><b>Second</b></p><b>Jersey</b></p><p><b>[311 show="value"]</b></p></td>[/e2pdf-if-do]
[/e2pdf-if]

[e2pdf-if][e2pdf-if-condition][304][contains]Travel Set[/e2pdf-if-condition][e2pdf-if-do]<td width="50"><p><b>Second</b></p><b>Jersey</b></p><p><b>[311 show="value"]</b></p></td>[/e2pdf-if-do]
[/e2pdf-if]
9 February, 2025 02:02:29
E2Pdf
Support
Topics: 7
Messages: 3438
Hello,

Are you using the [e2pdf-if] condition within the Formidable Forms [foreach] loop? If so, we were able to replicate the issue on our end and have already released a hotfix in the latest RC version: 1.27.11: https://e2pdf.com/docs/install#rc-version

After updating, it should work as expected. If the issue persists, please try creating a "textarea" field in the E2Pdf Template and setting its value as follows:

If it's NOT inside a [foreach] shortcode:
[304]
[304 show="value"]

If it IS used inside a [foreach] shortcode:
[304:1]
[304:1 show="value"]

Then, let us know which values are rendered.
We would really appreciate your feedback at WordPress.org!
9 February, 2025 19:07:57
recuniforms
Topics: 8
Messages: 47
The fix worked! But it seems to have reverted back ... ? It seems that it's struggling to read [304].
9 February, 2025 21:03:12
recuniforms
Topics: 8
Messages: 47
Here's the code I'm having an issue with:

<td>[e2pdf-format-output search="Rec Set (Jersey, Shorts & Socks)|||Travel Set (Jersey x 2, Shorts & Socks)|||Jersey Only|||Shorts Only" replace="Rec Set|||Travel Set|||Jersey Only|||Shorts Only"][304][/e2pdf-format-output] ([304 show="value"]) + Cust. x [395] ([396])</td>

It's outputting: Travel Set (Jersey x 2, Shorts & Socks).

It was working earlier.

Additionally, [==]Travel Set (Jersey x 2, Shorts & Socks) was working, but it's not anymore. I changed it to [contains]Travel Set and that is working.

I upgraded to the business version of Formidable if that's makes any difference.

Thanks in advance!
10 February, 2025 00:40:03
E2Pdf
Support
Topics: 7
Messages: 3438
Unfortunately, we are unable to replicate the issue on our end. Could you please provide a screenshot of your field setup and upload the complete code of the HTML to codefile.io for review?

We also recommend doing tests with new submissions after you upgrade to the business version.
We would really appreciate your feedback at WordPress.org!
10 February, 2025 00:42:31
E2Pdf
Support
Topics: 7
Messages: 3438
IMPORTANT:

Please ensure that the Disable WYSIWYG Editor option is checked on the HTML object.
We would really appreciate your feedback at WordPress.org!
10 February, 2025 04:41:12
recuniforms
Topics: 8
Messages: 47
I tried it again this morning and it seems to be working. I appreciate your help. I'm going to keep testing and will let you know if I encounter more issues. Thanks!
10 February, 2025 17:24:28
recuniforms
Topics: 8
Messages: 47
I've figured out how to trigger the error: the the code works when I complete the form while logged in; however, it does not work when I complete the form while logged out (on my phone or in incognito mode).

Here's the code:

<td>[e2pdf-format-output search="Rec Set (Jersey, Shorts & Socks)|||Travel Set (Jersey x 2, Shorts & Socks)|||Jersey Only|||Shorts Only" replace="Rec Set|||Travel Set|||Jersey Only|||Shorts Only"][304][/e2pdf-format-output] ([304 show="value"]) + Cust. x [395] ([396])</td>

When I look at the Formidable entry, I can't see a difference between the two submissions for [304] (logged in and logged out are identical).

Additionally, oddly, the date is day behind when I am logged out; it is correct when logged in.
10 February, 2025 17:25:26
recuniforms
Topics: 8
Messages: 47
I've attached examples.
11 February, 2025 01:02:51
E2Pdf
Support
Topics: 7
Messages: 3438
Hello,

We could replicate the issue on our side. It is an odd issue; however, it seems not related to E2Pdf.

For some reason, when the entry is submitted by a non-logged-in user, Formidable Forms uses a different way to output values. So, when the value is submitted by a logged-in user, it uses normal encoding, and the value is correct: Travel Set (Jersey x 2, Shorts & Socks). But when the entry is submitted by a non-logged-in user, Formidable Forms outputs it as Travel Set (Jersey x 2, Shorts &amp; Socks).

As you can see, it replaces & with &amp;, and this issue is also replicable in Formidable Forms Views (the native add-on). E2Pdf uses the native Formidable Forms core to render values, so the value is rendered differently.


We would really appreciate your feedback at WordPress.org!
11 February, 2025 01:10:44
E2Pdf
Support
Topics: 7
Messages: 3438
As a temporary solution, you can add & to be replaced with & firstly until we check if we can add a fix from our side and understand why two different encodings are used.

[e2pdf-format-output search="&amp;|||Rec Set (Jersey, Shorts & Socks)|||Travel Set (Jersey x 2, Shorts & Socks)|||Jersey Only|||Shorts Only" replace="&|||Rec Set|||Travel Set|||Jersey Only|||Shorts Only"][304][/e2pdf-format-output] ([304 show="value"]) + Cust. x [395] ([396])
We would really appreciate your feedback at WordPress.org!
11 February, 2025 05:00:33
recuniforms
Topics: 8
Messages: 47
Thank you! I've replaced '&' with 'and' and am comfortable with that.