• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Checkbox element - how to make no checkboxes until user adds them

Hi Hugh.
That's what I think should work; but I'm looking for an example of the JavaScript conditions & actions. I didn't see an option for if Null. Could I trouble you for an example of selections that should work?
Thanks in advance.
 
Just wondering if I should put in the predefined Javascript "If this element: ==" and "Value: Null"?
Also, I noticed that the related checkbox items only appear on the parent list if the related checkboxes are checked. This makes sense for most applications; but in this case we need the checkbox items to always appear on the parent list; regardless if the related checkboxes are checked. Is this possible? Maybe by adjusting some code in the DBjoin plugin?
Thanks in advance.
 
I've tried == Null, contains Null, =='' & contans''. It still won't hide the element. I don't know what to do at this point. Any suggestions?
Thanks in advance.
 
Hi Hugh.
Yes, I tried leaving value empty for element: == and I tried it with element: contains. No luck. Any other suggestions?
Thanks in advance.
 
Would it be easier to do this via the JavaScript code option versus the predefined action? Or, would it be easier via updating my custom Fabrik form template? If so; any suggestions?
Thanks in advance.
 
OK, so a 'load' event on the parent_id element, with this code:

Code:
if (this.getValue() === '') {
   jQuery('#your_repeat_table___element_to_hide_' + this.getRepeatNum()).closest('.fabrikElement').hide() 
}

Normally you'd use the Fabrik element object, like this.form.formElements.get('your_repeat_table___element_to_hide'), but when duplicating a group (which also fires the 'load' event for elements in the group), those objects don't exist yet for the new group.

-- hugh
 
Hi Hugh.
I tried your suggestion; but the DBJoin checkbox element still appeared on parent form additions (instead of hiding as expected). Maybe my syntax is off? Please take a look at my 3 attached snippet screen shots (1st of the JavaScript in the parent id element, and 2nd of the related repeat table & element to hide from phpmyadmin). Any more suggestions? Thanks in advance.
 

Attachments

  • Snippet1.JPG
    Snippet1.JPG
    90.5 KB · Views: 52
  • Snippet2.JPG
    Snippet2.JPG
    64.4 KB · Views: 46
  • Snippet3.JPG
    Snippet3.JPG
    88.7 KB · Views: 47
I just tried it and, unfortunately, no luck. It's still there on parent form additions. Any other suggestions?
Thanks in advance.
 
Hi Hugh.

Sorry for the delay. I got really tied up lately. I just updated "my Sites" in my profile with the related (including a link in the notes to point you to the form); if you still don't mind taking a look.
Thanks in advance, Hugh.
 
Hi Hugh.
Any luck on this?
I'm currently paused on 2 workflow solutions; pending the success of this.
Thanks in advance.
 
Hi Hugh.
I'm using Fabrik version 3.4.3. I've tried updating a few times in the past; but something usually broke when I did.
So, what do you recommend? Should I go ahead and try another Fabrik update to the latest; maybe on this cloned test copy first?
Thanks in advance.
 
Yes, absolutely. Not specifically to fix this (we could work around it) but because there's been several thousand code changes / bug fixes since 3.4.3.

I see you are also on J! 3.5. You *really* need to update to the latest J!, as 3.5 has some known security issues.

Update to J! 3.7.2, then update all Fabrik extension / plugins / modules via the J! updater.

If you run in to Fabrik issues, I'll help solve them.

-- hugh
 
Hugh,
I finally was able to get this to work using the following!
Code:
var vpochecklist = Fabrik.getBlock('form_6').formElements.get('bw_projects___po_checklist');
var vid = Fabrik.getBlock('form_6').formElements.get('bw_projects___id');
vidvalue = vid.get('value');
if (vidvalue === '') {
vpochecklist.hide();
}
else {
vpochecklist.show();
}
Now the new issue is that I really need the checkbox items to default to unchecked and also always still show in the parent fabrik list (weather the check boxes are checked or not). I know it sounds strange; but this dbjoin checkboxes list replaces a simple textarea element. The PO agent can then check off the POs that arrive and other users could see in the forms which POs have arrived. So, is this possible?
Thanks in advance.
 
Last edited:
Hi Hugh.
Any ideas on the last post? I'm wondering if there's something I can do in the DBJoin's Eval settings to make it work.
Thanks in advance.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top