Checkbox values based on previous element

Joomill

New Member
Hi,

I would like to have this situation.

Group A

Element 1: Checkbox
Option Value: 1 [ ]
Option Value: 2 [x]
Option Value: 3 [x]
Option Value: 4 [ ]

If a visitor checks value 2 and 3, Group B (on the next page) shows only:

Element 2: Checkbox
Option Value: 2 [ ]
Option Value: 3 [ ]

Is this possible and how can we create it this way?
Thanks in advance
 
Hmmm, that's not simple, and would require some custom JS.

What is your actual naming structure for the two checkboxes, and the values assigned to the first checkbox?

This would only be possible if you can programatically connect the selected values in the first checkbox with the placement in the second, either through them both having exactly the same structure (so the options are always in exactly the same positions on both checkbox lists), or there is some connection between the value (so option with value 3 in the first has value 3 in the second, or is in the third position), etc.

Anyway ... to start with, you'll need to add a form_X.js (where X is the numeric form ID) in ./components/com_fabrik/js, with a function in it you can call from the 'click' JS event on the first checkbox. Go ahead and create that, like this:

Code:
function doCheckboxSelect(el) {
  alert("I've been clicked!  My value is: " + el.get('value'));
}

... and then set up two JS events on the first checkbox, on for 'load', one for 'click', which both just call that function:

Code:
doCheckboxSelect(this);

Test that it's working, it should pop up a dialog with the selected values of the checkbox when you click on an option.

Then install the exTplorer J! extension, so I can get in and edit that form_X.js file.

Then put your site details in My Sites (link to the left of any of your posts). I just need the backend URL and a super admin login, no need for ftp or cpanel, etc.

Then respond to this post, with details of which form / element I need to look at, and where I can find the front end link to it. Technically I could work on the backend form, but I've found it's better to work on the front end, in case you have any J! template / JS / CSS issues which make the front end different.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top