Breezing Forms & Content Builder Conditional Fields

  • tyekynan
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 1

tyekynan created the topic: Breezing Forms & Content Builder Conditional Fields

I am using Breezing forms and ContentBuilder together. I have set up my form and went into content builder to create a new view. A problem I am having is. There are multiple conditional fields.

Resort;Resort_field

Room;Room_field1
Room;Room_field2
Room;Room_field3

View;View_field1
View;View_field2
View;View_field3

When I view this in the content builder, I would like for all the View conditional fields to be in 1 column (together), same with the Room fields.

My plan is to use these 2 components together as a type of ticket system to keep track of reservations. User submits a form through breezing forms. We can view the reservations on contentbuilder and edit them if we need to. There will be some fields within the form that only an admin on the site can see like, reservation# and notes. This way, once the room has been booked we can go in and add the reservation number to this set of data, or notes if we need to keep track of some things.

But mainly, I would like content builder to pull in columns based on the label of the field and not the name of the field (I realize it doesn't necessarily work this way). But, considering I have 7 room fields, I would like for that info to go to the same column. Not every resort has the same type of rooms, hence the conditional room fields, but they are all still room values no matter which room field is used.
#233617
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: Breezing Forms & Content Builder Conditional Fields

Hello,

There isn't a simple way to show multiple conditional fields to be in one column (depending on which one is displayed and filled in).

Despite that, there is a way to achieve what you want.

What you could do is you could create a additional Textfield element in your form and then using code put there the selected value.
You would do this in a way that you would loop through the possible conditional fields and then take the value from the one that was filled in.

This way, since value will be copied to this one textfield, you could have a single column in the view. I hope you understand what I am trying to explain.

Let me know if you have more questions regarding this.

Regards,

Mihaela
#233637
  • tyekynan
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 1

tyekynan replied the topic: Breezing Forms & Content Builder Conditional Fields

Could you get me started in the right direction on how to achieve this?
#233687
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: Breezing Forms & Content Builder Conditional Fields

Hello,

Here are some guidelines how to do so.

First you need to create a Hidden input element in your form named let say "Room_field".

As from the other topic I know you have an Initialization script put there to show/hide elements, in my opinion the best way is to put there the code to fill in this filed.

If you have left the visibility rules in form's Advanced properties, then for room selection add code like this to "function showorhide()":
if(ff_getElementByName('Resort_field').value == "value1") {
      ff_getElementByName('Room_field').value = ff_getElementByName('Room_field1').value ;
}
else if(ff_getElementByName('Resort_field').value == "value2") {
      ff_getElementByName('Room_field').value = ff_getElementByName('Room_field2').value ;
}
else if(ff_getElementByName('Resort_field').value == "value3") {
      ff_getElementByName('Room_field').value = ff_getElementByName('Room_field3').value ;
}
NOTE: You would have to replace "value1" "value2" and "value3" with the actual values of options in select list 'Resort_field'.

For the View select lists, create another form element named "View_field".
Then to the initialization script add this line of code:
ff_getElementByName('View_field').value = ff_getElementByName('View_field1').value ;
after this line:
bfToggleFields('on', 'element','View_field1' , bfDeactivateField);

Here I assume that you have a code like this:
if(ff_getElementByName('Resort_field').value == "value1" && ff_getElementByName('Room_field1').value == "value1") {
          bfToggleFields('on', 'element','View_field1' , bfDeactivateField);
          bfToggleFields('off', 'element','View_field2' , bfDeactivateField);
          bfToggleFields('off', 'element','View_field3' , bfDeactivateField);
          bfToggleFields('off', 'element','View_field4' , bfDeactivateField);
     }

I hope you understand what I am trying to explain.

Let me know if you have more questions and whether you've managed to set this for your form.

Regards,

Mihaela
#233709
  • tyekynan
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 1

tyekynan replied the topic: Breezing Forms & Content Builder Conditional Fields

I have started with passing off the room value. It works, but only for the first resort... If I select any other resort first, I get nothing. If I select the first resort it works, but then if I select a different resort, it only keeps the value from the first resort.
#233730
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: Breezing Forms & Content Builder Conditional Fields

Hello again,

I assume that you have put the code I've suggested in the wrong place.

Could you send me the whole code so I can see what might be set up wrong?

It should be put after this line of code:
function showorhide() {

Regards,

Mihaela
#233761
Moderators: ForumSupporttomeperica
Time to create page: 0.070 seconds

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

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€

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!

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