Visibility rules and validation

  • aeovi
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

aeovi created the topic: Visibility rules and validation

Hello,

We are currently building a form using add_delete rows script. Everything works perfect
except the validation rules. The first section is always visible and the validation on those fields inside this section works. The 2nd section is hidden and appears when the button "add row" is clicked, the problem here is that the elements which are inside the section are not validate. Is there a way we can fix that?

Thanks in advance!
#237910
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2651
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Visibility rules and validation

Hello,

Here is an explanation on how to set the Add Delete rows functionality so that validations work properly.

I am sending you a new AddDeleteRows script. Unzip and install it. To install it go to Components > BreezingForms > Configuration > Package Installer.
After you install it you can see how the new script looks like if you go under Components > BreezingForms > Manage Scripts, set Package field to FF and look for a script with the Title Add Delete Rows.
In that script, you don't have to change anything.

The changes that you need to make to the form from the link on our documentation page are the following:
1) Change the name of second section from s2 to S2
2) In Advanced options of the second section check the Turn off checkbox
3) Go to Advance options of the form and in Visibility rules field write some dummy visibility rule, for example write turn on element mydummy if yourdummy is dummy , literally
4) Go to Advance options of the form, then go to More options > Scripts > Initialization Script, set Type to Custom and in the code replace
WrapperScriptAddDelete();
with
ff_addDeleteRows(1,10,'S','add_row','del_row');

NOTE:
The parametars of the function are defined as follows:
ff_addDeleteRows(startRow, maxRow, sectionName, addButton, delButton)

1) startRow is the number of initial rows visible
2) maxRow is the maximum number of rows you can have
3) sectionName is the name of the sections you are adding with the script, without the number
4) addButton is the name of Add Row button in your form
5) delButton is the name of Add Row button in your form

This is the example that will work on the form from our documentation.
You can change the form according to your needs, but note that sections must have same names with numbers starting from 1 at the end. Also, if you change number of sections, or Add and Delete button names change it here:
ff_addDeleteRows(1,10,'S','add_row','del_row');

I hope this will help you, and that you will manage to set everything according to your needs.

Let me know whether everything works as it should after you do as explained above and if you have more questions feel free to ask.

Regards,

Mihaela
#237925
Attachments:
The following user(s) said Thank You: aeovi
  • aeovi
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

aeovi replied the topic: Visibility rules and validation

Hello Mihaela,

Thank you so much for your quick and detailed reply! Everything worked as you described! :)
#237954
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2651
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Visibility rules and validation

Hi again,

I'm glad I've helped and that this is working as you wanted. :)

Regards,

Mihaela
#237958
Moderators: ForumSupporttomeperica
Time to create page: 0.088 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