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

To condition number of allowable values ??in a checkbox field based on the value of another field

Status
Not open for further replies.

georgie

Member
hello

Everything is in the title! Is this possible?

Let me clarify my question:

I have 2 fields (a radiobutton with 4 options and a checkbox with 8 options).

I wish that one of the values ??of the radiobutton forces the checkbox to support only a single value (prohibiting multiple selection).

Can you help me !
 
It would need some custom JavaScript. If you point me at your page (or fill out your My Sites), and let me know which buttons are which, etc ... I'll see if I can come up with the code for you.

-- hugh
 
Ok

I have filled information about my website, with a super-user.

But if I had a code example, maybe I could do it myself.

Anyway, thank you !
 
Hello

Do you prefer that I describe precisely the page, the URL, the need...?

Have you tried to connect?

###THX
 
Well, no, I can't look, as there is still nothing listed in your My Sites.

Can you double check, make sure you filled it in and saved it?

-- hugh
 
OK thx

I have filled informations about my website in my profile (there are fields dedicated).

Where is the real "My sites" option ?
 
I can't find anything to do with logins in your profile, just a link to the driihm site.

I'll check back later to get the full details once you get it in to that sites list, which should be here:

http://fabrikar.com/you/my-sites

You'll need to be logged in to the J! side of the site to see / fill them.

-- hugh
 
Ok thank you

I have filled information about my website, with a super-user for you.

My website is in 3 languages, and the need must be implemented on several forms.

To work, I suggest we work on the English form, available here (once logged in):

http://driihm.fr/en/enter-a-research-project

The name of his list, in the admin, is "Research Projects to enter".

My need is about the 2 fields "Type of project (type)" and "OHM(s) involved (ohm)", at the top of the form, in the block "Project Reference".

I await confirmation of your good connection to get into the details.

###thx
 
In your original post you said:

I wish that one of the values ??of the radiobutton forces the checkbox to support only a single value (prohibiting multiple selection).

So which value on the "Type of Project" should force the "OHMs involved" to be single selection? And what do you want to do if there is already more than one selection on the checkbox, when that Type value is selected?

You'll need to either give me an ftp login (in My Sites), or install the exTplorer component:

http://extensions.joomla.org/extensions/core-enhancements/file-management/2630

... so I can create and edit a custom JS file for you.

-- hugh
 
Ok, great thank you

The value which must force the unique selection is "Projet OHMs" (titled in English: "OHM Project").

If several choices are already selected, I would like the selection is canceled, reverting all the boxes empty.

But why do you need FTP access? Javascript can not be combined in the javascript tab of the item, along with other existing rules?

THX !
 
But why do you need FTP access? Javascript can not be combined in the javascript tab of the item, along with other existing rules?

As I said, I need to create a custom JS file. This can't be done using the element JS events. Or rather, I can't do it that way. I'll need to debug the code when I'm writing it, which I can't do using the inline JS events. If this was one or two really simple lines of code, I could do that, but for anything more than that, I need to create a ./js/form_X.js file with the code in it, so I can debug it, put break points in it, etc.

So, I'll need either an ftp account, or you can install the exTplorer component (which would actually be slightly easier for me).

I never ask for access I don't need. If I ask for it, I need it, and can't do what you are asking me to do without it.

-- hugh
 
OK, should be done.

The code is in ./coomponents/com_fabrik/js./form_48.js

The clever bit is some jQuery which does this:

Code:
jQuery("#projets___ohm :checkbox").on('click', function() {
    if (jQuery('input[name="projets___type[]"]:checked').val() == 'Projet OHMs') {
    jQuery("#projets___ohm :checkbox").not(this).attr('checked', false);
    }
});

Which checks to see if the 'type' radio button is set to "Projet OHMs", and if so, de-selects all the "not(this)" targets of the click event.

That event is set up in the loadOhmsInvolved() function, which is invoked from a JS 'load' event on your projets_ohm element.

The only other code is a function, doOhms(), which is fired from a 'click' event (in the JS events on the 'type' element), which will de-select all the ohm checkboxes if a) the value of the type selection is "Projet OHMs" and b) there is more than one OHM selected.

Let me know if it works for ya. I tested it, seems to work for me.

http://screencast.com/t/RtFm2Fu8UX


-- hugh
 
Hi !

Ok, it seems to be perfect !

I have positively upgrade other forms with your modifications. Many Thanks !!!!

However, I see that the view detail do not take into account all my Java rules, but I don't know if it is related. I have turn off my view details, which are not indispensable.

Again : thank you !!!!
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top