Skip Navigation

[Resolved] Hide empty field form in notification

This support ticket is created 3 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 9 replies, has 2 voices.

Last updated by Minesh 3 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2034653

Hi,

I have a form with many checkboxes (each are separate checkboxes).

I want the notification to display only the checked checkboxes. I tried usual toolset conditional code but it seems to not work.
[wpv-conditional if="( $(wpcf-mycheckbox) eq '' )" evaluate="false"][types field='mycheckbox'][/types][/wpv-conditional]

Is there a workaround for that?

Many thx

#2034991

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Do you mean that you want to conditionally display the custom field within the form email notification?

If yes:
I would like to first review how you setup your custom checkbox field.

Can you please share problem URL where you added your form and tell me on what condition you want to display the custom field within the form's email notification.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2035365
Untitled-4.jpg

Hi Minesh,

You can see it there: hidden link

This is a form where people can choose an advertising size. Then it's sent by email to my client.

I want my client to get only the checked size. See attached picture of the email I get.

Many thx

#2035383

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I will require admin access details and please share the form link where you setup the email notification so I can check if there is a way to remove those additional spaces.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2035421

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

As I understand you want to check that checkbox is checked or not.

what if you try to add the conditional statement as:

[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]' ne '' )"]
test de condition[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]
[/wpv-conditional]

OR

[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '' )"]
test de condition[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]
[/wpv-conditional]

We are checking that if checkbox value is not empty then display the content. You can adjust the condition as per your requirement.

Does it works?

#2035609
Capture-d’écran,-le-2021-04-28-à-10.30.18.jpg

Hi Minesh,

Thank you for your help.

I'm afraid it doesn't work.

I tried many combinations:

[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]' eq '0' )" evaluate="false"]<strong>[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]</strong><br>[/wpv-conditional]
[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]' eq 'Huitième de page horizontal noir et blanc' )"]<strong>[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]</strong><br>[/wpv-conditional]
[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]' ne '' )" evaluate="false"]
<strong>[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]</strong><br>[/wpv-conditional]

(yours)

[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '' )"]
<strong>[types field='huitieme-de-page-horizontal-noir-et-blanc'][/types]</strong><br>[/types][/wpv-conditional]

(yours too. In this particular code, I don't understand what's the utility of

item='%%POST_ID%%'

Thx again!

(I found a little bug: if I toggle the Form Editor panel up, I loose all my html customization. See attached picture. Hopefully I always keep a backup :o)

#2036475

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now.

I've adjusted the email notification body content with [wpv-conditional] shortcocde as given under:

Bonjour,<br>
<br>
Vous avez reçu une demande de publicité :<br>
<br>
Entreprise : <strong>%%POST_TITLE%%</strong><br>
Nom : <strong>[types field='prenom-et-nom'][/types]</strong><br>
Courriel : <strong>[wpv-user field="user_email"]</strong><br>
Téléphone : <strong>[types field='telephone'][/types]</strong><br>
Adresse : <strong>[types field='adresse'][/types]</strong><br>
<br>
Publicité choisie :<br>

<strong></strong><br>
[wpv-conditional if="( '[types field='cahier-communautaire-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='cahier-communautaire-noir-et-blanc'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>Huitième de page horizontal noir et blanc</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='huitieme-de-page-vertical-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='huitieme-de-page-vertical-noir-et-blanc'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='quart-de-page-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='quart-de-page-noir-et-blanc'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='bandeau-horizontal-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='bandeau-horizontal-noir-et-blanc'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='demi-page-horizontale-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='demi-page-horizontale-noir-et-blanc'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='demi-page-verticale-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='demi-page-verticale-noir-et-blanc'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='page-complete-noir-et-blanc' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='page-complete-noir-et-blanc'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='huitieme-de-page-horizontal-couleur' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='huitieme-de-page-horizontal-couleur'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='huitieme-de-page-vertical-couleur' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='huitieme-de-page-vertical-couleur'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='quart-de-page-couleur' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='quart-de-page-couleur'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='bandeau-horizontal-couleur' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='bandeau-horizontal-couleur'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='demi-page-horizontale-couleur' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='demi-page-horizontale-couleur'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='demi-page-verticale-couleur' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='demi-page-verticale-couleur'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='page-complete-couleur' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='page-complete-couleur'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='manchette-couverture-1' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='manchette-couverture-1'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='manchette-couverture-2-ou-3' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='manchette-couverture-2-ou-3'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='demi-page-horizontale-couleur-endos' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='demi-page-horizontale-couleur-endos'][/types]</strong><br>
[/wpv-conditional]

[wpv-conditional if="( '[types field='demi-page-verticale-couleur-endos' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='demi-page-verticale-couleur-endos'][/types]</strong><br>
[/wpv-conditional]


[wpv-conditional if="( '[types field='page-complete-couleur-endos' item='%%POST_ID%%'][/types]' ne '0' )"]
<strong>[types field='page-complete-couleur-endos'][/types]</strong><br>
[/wpv-conditional]

<br>
<br>
Votre site internet <strong><a href="<em><u>hidden link</u></em>" target="_blank">JdrEstrie.ca</a><br></strong>
<br>
<a href="<em><u>hidden link</u></em>" target="_blank"><img src="<em><u>hidden link</u></em>" alt="Logo Journal de rue de l'Estrie" width="200" /></a>

Can you please confirm now that it works as expected.

#2036803

Hi Minesh,

You mean you edit ALL the itesm of the notification?!?

Wow, I didn't expect you'll do all this work! Many many thx!

(it's me or your still editing? I would like to check but I don't want to kick you off :o)

#2036827

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm not editing now, you can take over and I'm happy to share the solution.

Please feel free to mark resolve this ticket.

#2037481

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please confirm that solution I shared help you to resolve your issue and mark resolve this ticket.