Contact Form 7 – Conditional Fields Pro

Almost here!

The first version of Conditional Fields Pro is almost here. Subscribe to the ONE TIME newsletter that will be sent after the pro version is released. I will never email you again after that. Promise!

What’s so Pro about it?

CF7 – Conditional Fields Pro adds support for some more advanced operators.

Relational operators

greater than (>), less than (<), greater than or equal to (>=), less than or equal to (<=).
is empty, is not empty.

Form

456

the field value is greater than 5
the field value is less than 5
the field value is less than or equal to 5
the field value is greater than or equal to 5
the field value is equal to 5
the field value is not equal to 5
the field value is empty
the field value is not empty

Form Code

[checkbox number "4" "5" "6"]
[group group-greater-5]
the field value is greater than 5
[/group]
[group group-less-5]
the field value is less than 5
[/group]
[group group-less-eq-5]
the field value is less than or equal to 5
[/group]
[group group-greater-eq-5]
the field value is greater than or equal to 5
[/group]
[group group-eq-5]
the field value is equal to 5
[/group]
[group group-not-eq-5]
the field value is not equal to 5
[/group]
[group group-empty]
the field value is empty
[/group]
[group group-not-empty]
the field value is not empty
[/group]

Conditional Fields

show [group-not-empty] if [number] not empty ""
show [group-empty] if [number] is empty ""
show [group-less-eq-5] if [number] <= "5"
show [group-greater-eq-5] if [number] >= "5"
show [group-less-5] if [number] < "5"
show [group-greater-5] if [number] > "5"
show [group-not-eq-5] if [number] not equals "5"
show [group-eq-5] if [number] equals "5"

Regular expressions:

equals (regex), not equals (regex)

Form

Try entering texts containing hello, and one that contains an email address

the text contains the word hello
the text doesnt contain the word hello
the text IS NOT a valid email address.
the text contains an email address
the text IS an actual email address

Form Code

[text txt]

Try entering texts containing hello, and one that contains an email address

[group hello]
the text contains the word hello
[/group]

[group no-hello]
the text doesnt contain the word hello
[/group]

[group is-no-email]
the text IS NOT a valid email address.
[/group]

[group email]
the text contains an email address
[/group]

[group is_email]
the text IS an actual email address
[/group]

[submit "Send"]

Conditional Fields

show [no-hello] if [txt] not equals (regex) "hello"
show [is-no-email] if [txt] not equals (regex) "^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$"
show [is_email] if [txt] equals (regex) "^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$"
show [email] if [txt] equals (regex) "[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}"
show [hello] if [txt] equals (regex) "hello"

Toggle button:

Form

Nice! Here are some Terms and conditions (not really)

Cool! Since you agree to our conditions, you have the privilige of clicking this submit button.

Noting got submitted.

Form Code

[togglebutton toggle-1 "Show" "Hide"]

[group group-1]
Nice! Here are some <a href="http://example.com/" target="_blank">Terms and conditions</a> (not really)

[togglebutton toggle-terms "I read your stupid terms and I agree" "I do not agree"]

[group group-2]
Cool! Since you agree to our conditions, you have the privilige of clicking this submit button.
[togglebutton toggle-submit "Submit" "PSYCH!!"]

[group group-3]
Noting got submitted. 
[/group]
[/group]

[/group]

Conditional Fields

show [group-1] if [toggle-1] equals "Hide"
show [group-2] if [toggle-terms] equals "I do not agree"
show [group-3] if [toggle-submit] equals "PSYCH!!"