CFv6 Radio selection modify other radios choices

Carmiel 13 May, 2017
Hi dears,
I try to do something but doesn't understand what to do.
I do a survey for my association to organize a journey. Let's assume I want user to indicate me 3 destinations, but priorize them in there choice.
So I have
radio1 : Choice 1 : 1=Destination1, 2=Destination2, 3=Destination3, 4=nochoice
radio2 : Choice 2 : 1=Destination1, 2=Destination2, 3=Destination3, 4=nochoice
radio3 : Choice 3 : 1=Destination1, 2=Destination2, 3=Destination3, 4=nochoice
- First I want the user to fill Choice 1 at first time, so filling Choice1 unlock Choice 2, filling Choice 2 unlock choice 3
- If he choose Choice1/Destination1, so Destination1 should be locked at Others choices

I tried Choice1/2/3 as radios group
I tried to use event at Choice1 radios group but did not success to trigger an event.
It seems to be simple, but I don't understand anything, I just got lost.

Have you any idea of how to that, if possible ?

Thank's a lot
Regards
GreyHead 14 May, 2017
Hi Carmiel,

You will need to write custom JavaScript to get this to work the way you describe. You would need to disable and.or hide the corresponding option in the later later radio button groups.

Bob

PS I vaguely remember a similar question here quite a while ago but it will have been for an older version of CF.
Carmiel 14 May, 2017
Thank's for your answer so quick :-)
That's what you mean
https://www.chronoengine.com/forums/posts/t101419/2-radio-button-first-selection-exclude-value-in-the-second-radio.html

I saw that, but what I don't understand is where to put this code.
I'am just starting with Chronoforms, it's a so usefull tool, but a little bit hard to understand all.

Thank's for all
GreyHead 15 May, 2017
Hi Carmiel,

In CFv5 the JavaScript would go into a Load JavaScript action in the form On Load event - I assume that is the same with CFv6.

Bob

PS I'm sorry that the formatting makes the code hard to read - that's a serious forum bug that Max has yet to fix.
Carmiel 15 May, 2017
Hi Bob,
I will try to do so tomorrow.
My first try was unsuccessful.
I will come back asap.
Roland
Carmiel 16 May, 2017
Hi Bob,
so sorry, it doesn't work. I tried this in a custom code in setup folder, tried also in Designer one.
Tried debug, but nothing happen.
Have you got an example done with backup form ?
Thank's a lot

jQuery(document).ready(function(jQ) {
jQ('input[name=choix1]').on('click', function(el) {
var chosen = jQ(el.currentTarget);
chosen = chosen.prop('id');
chosen = chosen.replace('choix1', 'choix2');
jQ('input[name=choix2]').each( function() {
jQ(this).prop('disabled', false);
});
jQ('#'+chosen).prop('disabled', true);
});
});
Max_admin 17 May, 2017
Hi Carmiel,

The next v6 update has a new field event type named "reload", which can rebuild an element using AJAX, I think that it can be useful here, you configure the first radio to rebuild the next radios, so that the selected values are not available in the next ones.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Erstech 17 Jan, 2019
Hy! I want to ask you that is it possible to set up a hidden part of the form that is revealed if an exact radio button is selected.

b.r.
Jano
GreyHead 17 Jan, 2019
Hi Jano,

Yes it is - you can do that from the Events tab of your Radio Buttons element.

Bob
Erstech 18 Jan, 2019
Hello Bob,

Can you give me an example?
I want it to show 2 text fields, so on the events i set up "selection", set actions to show, and set the elements identifier #id (the text fields id).

Jano
Max_admin 30 Jan, 2019
1 Likes
Hi Jano,

Set the "action" to "show" and in the "Element identifier" you can enter 2 fields names in 2 lines, or 2 ids:
#field_id_1
#field_id_2
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Erstech 30 Jan, 2019
Hi Max,

Thanks, I'll try it.

Best Regards
Jano
Erstech 05 Feb, 2019
Hi,

The form works but only if it is in the preview view (radio button).
If I insert the joomla, the radio button will not work.
What could be the problem?

Jano
healyhatman 05 Feb, 2019
Any errors in your javascript console?
Erstech 05 Feb, 2019
I found these:

- Failed to load resource: net::ERR_NAME_NOT_RESOLVED
- Uncaught ReferenceError: JCEMediaBox is not defined
at (index):2
- Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID
Max_admin 05 Feb, 2019
1 Likes
If there is a JS error on the page then it can break the code Chronoforms uses for layout changes, you need to solve that error, try to disable the JCEMediaBox plugin.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Erstech 06 Feb, 2019
Hi Max,

Thank you very much! It already works normally.
:)

Best regards
Jano
Erstech 06 Feb, 2019
The joy was short ...... the form is already showing well, but nothing is sent to the send button.
What haven't I set up yet?
healyhatman 06 Feb, 2019
Don't know without seeing. What does your submit event look like? Have you tried a debug action?
Erstech 06 Feb, 2019
The radio buttons will have an error ..... 3 buttons and one of them has been sent.

[c849598646c9e5bc54abfd6527777da5] => 624ee0a05060e778d37e6eb6a0d3ee9d [_gat] => 1 [Itemid] => 684 [option] => com_chronoforms6 [view] => form)
Erstech 07 Feb, 2019
https://www.tecnoalarm.hu/index.php/kapcsolat/regisztracio
healyhatman 07 Feb, 2019
You have javascript errors because your site is trying to load something from localhost (192.168.1.2) for some reason.
Erstech 07 Feb, 2019
This error has been resolved - It was a wrong piwik link. But sending is still not working.

Only the "telepito" radio button works.
The registrant does not receive a confirmation on the screen.
Max_admin 11 Mar, 2019
And with the latest update ?

You should check if the field value is available in the debug or not!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.