[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