• 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.

Clearing Elements

Folks

I have some groups that are displayed when various JS actions are performed on Y/N elements (Slide out, Slide In Etc)

The elements are DB Joins and CDD elements. I have tried doing a "clear" against the group using a check box and also attaching it to the Y/N elements but it is not working

What i need is if the Y/N element is selected to No (0), it resets the values in the DB Joins & CDD elements and clears the values

Possible?

Thanks
 
maybe with a validation on your Y/N element ?? But it's better if a more capable ( and with JS and PHP knowledge ) member help you on that
 
Folks

I have some groups that are displayed when various JS actions are performed on Y/N elements (Slide out, Slide In Etc)

The elements are DB Joins and CDD elements. I have tried doing a "clear" against the group using a check box and also attaching it to the Y/N elements but it is not working

What i need is if the Y/N element is selected to No (0), it resets the values in the DB Joins & CDD elements and clears the values

Possible?

Thanks
I'd just use a custom javascript file for the form. See: http://fabrikar.com/forums/index.php?wiki/javascript/

Maybe this example will help/inspire.
Assuming that your Yes/No element in the form is in the table 'fb_report' - And the element name is 'applied' - And your database join element that you want to 'reset' has the id 'fb_report___members'...
then your form_##.js file might look like this...

Code:
jQuery(document).ready(function()
{
 
    jQuery(document).on("click","input[name=fb_report___applied]", function()
    {
        if(jQuery(this).val() == "1")
        {
            // Here include code/functions for if label 'Yes' was just selected
        }
        else
        {
            // Here include code/functions for if label 'No' was just selected
            // e.g. This line code would deselect all of the databasejoin select options...
            jQuery("#fb_report___members option:selected").prop("selected", false);       
        }
    });
 
});


If the Yes/No element is in a repeat group, then the javascript code would need to be a little different.

You would have to use the ^ (begins with) wildcard to catch all the repeat groups.

And you would have to use a combination of closest() and find() to locate and work with only the databasejoin element in the current repeat group.

E.g....

Code:
    jQuery(document).on("click","input[name^=fb_report___applied]", function()
    {
        if(jQuery(this).val() == "1")
        {
            // Here include code/functions for if label 'Yes' was just selected
        }
        else
        {
            // Here include code/functions for if label 'No' was just selected
       
            // e.g. This line code would deselect all of the databasejoin select options
            // and assure it only affected the databasejoin in the current repeat group...
            jQuery(this).closest(".fabrikSubGroup").find("#fb_report___members option:selected").prop("selected", false);           
        }
    });
 
I have tried to resolve this with no luck - is anyone able to help at all? Thanks


Sent via my iPhone using Tapatalk app so please excuse brevity and typing errors :)
 
It's all done - thanks for the help :) - do I close this as resolved? - thanks again


Sent via my iPhone using Tapatalk app so please excuse brevity and typing errors :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top