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

[SOLVED] Javascript Clear Question

Status
Not open for further replies.

SoilentRed

Caaan do!
I have a very long form. Like 80 questions. They are broken into groups.

One of the first questions we ask determines which groups the form will show/hide via javascript presets in fabrik. that all works great.

At the end of the form, there is a calc element that does a lot of stuff and generates a summary report. Lots of if-else happening there.

My concern: because of the pagination, the user can go back to a previous section and put in a different answer for that one question that sends them down a given path. So, if they started answering questions down avenue B, then backtracked and went down avenue A, it screws up my calc at the end of the form.

I've tried using the Javascript "clear" preset to clear the elements in the group to handle the situation, but on testing, it is not clearing out the entries. Does clear only work for elements and not groups?
 
Do you need to see this calculations before is save?

because if after save you can show all the calculations using php and some php functions.
 
Yes, element javascript "clear" does not clear all the elements values in the group, but in mainly meant for clearing one text field value.

In element Javascript you can use the custom code section and add the code manually to clear the fields you need. And with different element type's you have to have a different approach. E.g for field element you can use:
jQuery('#table_element').val('');

for dropdowns something like:
jQuery('#table_element').prop('selectedIndex',0);

etc.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top