Summarize Element visibility condition

  • Pascal Kurmann
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 95
  • Thank you received: 0

Pascal Kurmann created the topic: Summarize Element visibility condition

Hi

Is it possible to make a summarize element invisible, if another summarize element has an input?

I have a form where you can choose a color from radio elements or you can type something in a custom text element.

I want that the summarize element of the radio element goes invisible or deactivated if something is filled in the text element.

Thank you for your help.

Regards,
Sandro
#236700
  • Posts: 2553
  • Karma: 87
  • Thank you received: 343

mihaela replied the topic: Summarize Element visibility condition

Hello,

Here is how you can make it work.

Please navigate to your form's Advanced properties > More options > Scripts and in the Initialization script section set Type to Custom. In the code area below put piece of code similar to this one:
function ff_FORMNAME_init()
{  setInterval(showorhide, 500);
} // ff_FORMNAME_init

function showorhide() {
  if(ff_getElementByName("COLORFIELD").value != "") {
    jQuery("#bfElemWrap5530").css("display","none");
    }
}
NOTE: In the code above replace FORMNAME with the Name of the form. Furthermore, replace COLORFIELD with the Name of that custom text element where user can enter something and on which depends whether the summarize element will be displayed.
Finally, you have to replace bfElemWrap5530 WITH the ID of the div that contains the summarize element that you wish to hide. You can retrieve it by Inspecting the element.

After this, the radio group summarize element shouldn't be shown in case something is entered on the text element.

Let me know whether you have managed to apply this to your form and whether this works as you wanted.

Note that the radio group element's value won't be erased, it will be kept and only it's summarize element won't be displayed.

Regards,

Mihaela
#236716
  • Pascal Kurmann
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 95
  • Thank you received: 0

Pascal Kurmann replied the topic: Summarize Element visibility condition

Hello Mihaela

Thanks, I guess this kind of works.
Is it not possible to erase the radio group element value?

Because with your soloution it only works for the user who fills out the form (which is certainly good). But with this, the radio value would still be sent in the email, correct? Or does it get erased in the email as well if it is not displayed?
This could cause some confusion.

Is there a way to fix this?

Regards,
Sandro
#236717
  • Posts: 2553
  • Karma: 87
  • Thank you received: 343

mihaela replied the topic: Summarize Element visibility condition

Hello again,

Yes, there is a way to do so. It seems I did not understand at first correctly how this is supposed to work.

Here is the code that will uncheck all radio group options when something is entered in the text field.
function ff_FORMNAME_init()
{  setInterval(showorhide, 500);
} // ff_FORMNAME_init

function showorhide() {
  if(ff_getElementByName("COLORFIELD").value != "") {
     jQuery('[name="ff_nm_RADIOGROUPNAME[]"]:checked').prop("checked", false);
    }
}
NOTE: Only one line of code is changed and there you need to replace RADIOGROUPNAME with the name of the radio group in which user chooses a color.

To make that element not to appear in summary page you can check the "Hide row if empty" checkbox in the Properties of that summarize element.

Let me know whether this works as you wanted.

Regards,

Mihaela
#236724
  • Pascal Kurmann
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 95
  • Thank you received: 0

Pascal Kurmann replied the topic: Summarize Element visibility condition

Hi Mihaela

It works perfectly. Thank you.

I have another question wich is kinda similar:
Is there a way to hide/show elements in the email that gets sent out?

In my form there are a lot of fields that are optional.
If you don't fill out these optional element there is a lot of empty space in the email.
And I have written normal titles that show anyway, because they are normal html elements in the mail.
Is there a way to also make these invisible?

I attached an image. I hope it's clear what I mean.

(Should I make a new topic for this?)

Regards,
Sandro
#236729
Attachments:
  • Posts: 2553
  • Karma: 87
  • Thank you received: 343

mihaela replied the topic: Summarize Element visibility condition

Hello,

I know what you mean.

There isn't a way to avoid the labels of empty fields to be displayed if you are using the custom email option in form's Advanced options.

If you use the default email looks, then labels of the empty fields won't be displayed.

If you wish to have a custom email look, but you don't want the labels of empty elements to display, there is a way to achieve that as well.

In that case, you would have to create a custom email template as explained here crosstec.org/en/support/online-documenta...-templates-work.html .
Create a template this way would require some coding knowledge.

Take a look at this topic since here it is explained how to avoid empty lines in custom email crosstec.org/en/forums/15-usage/124980-m...y-fields.html#230078 .

Let me know whether this helped.

Regards,

Mihaela
#236739
Moderators: ForumSupporttomeperica
Time to create page: 0.193 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here