Skip to content

Testing forms in Orchard CMS #17598

Answered by Kjszywala
Kjszywala asked this question in Q&A
Mar 11, 2025 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

{% assign email = Request.Form.Email | strip %}{% if email == '[email protected]' %} [email protected] {% else %} [email protected] {% endif %}

The issue was likely due to hidden characters, such as extra spaces or line breaks, in the Request.Form.Email value. This caused the conditional comparison to fail, even though the email appeared correct.

To resolve this, I used the strip filter in Liquid to remove any leading or trailing spaces from the input value before performing the comparison.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@Kjszywala
Comment options

@Piedone
Comment options

@Kjszywala
Comment options

Comment options

You must be logged in to vote
1 reply
@Piedone
Comment options

Answer selected by Kjszywala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants