Forums

Is this a bug - reload doesn't appear to be reloading radio buttons so that previously selected values can be forgotten?

indieben 04 Feb, 2019
I have followed the instructions in the manual at pages 37 - 38.

I have a set of radio buttons (set 1) that decides when another set of radio buttons displays (set 2). In the case that a user selects a different option in set 1, the second set of buttons disappears - that's what I intended - so far so good.

Set 2 has events itself set to display and hide fields.

The issue is that, if the user has selected an option in set 2 to begin with and then they go back and change the option in set 1 that sets set 2 to disappear, if they select the correct option in set 1 to make set 2 reappear again, the items set to display with set 2 do not reappear but the set 2 radio button is already depressed. The only way around this currently is for the user to set the wrong option to select the correct option and they are not going to know to do that and it makes us look very unprofessional.

In short, I need set 2 to have it's selection cleared when a change is made in set 1 so that the correct fields running down the page can be manually activated by the user.

If you want a graphical representation of this please visit https://www.samspencerit.co.uk/

Scroll to the bottom, select the training option and a form will appear.

Select "Individual"

Select "myself" in the second set of radio buttons that appear.

Then select "Business"

Then select "Individual" - you will see that although myself is still populated, the dropdowns are not. I need rid of that dot (in the myself box) in this scenario.

The reload action is supposed to clear that box from my understanding. Is this a bug? Many thanks.
healyhatman 05 Feb, 2019
Yes it is a bug, it's been mentioned a few times before. Pretty sure the dev knows about it.
indieben 05 Feb, 2019
Thanks for getting back to me healyhatman, is there any way to get around it in the meantime please? Thanks man.
healyhatman 05 Feb, 2019
Add a function after the reload to clear the selection. Should be able to find out how in the Semantic UI documentation.
indieben 05 Feb, 2019
Thanks for this but I have no idea what I am looking for.

I thought about a function and some JS script - however - calling anything within the events box of the trigger field requires a radio box value, the next radio box needs to be called and this does not leave anywhere for a function to be called.

I did try added an additional event with custom code in it to the trigger field using JS to clear the radio button setting but it didn’t work and I left the reload event code within the radio box field to be changed in trying.

Thanks.
Max_admin 21 Feb, 2019
with the latest update a "Reload" will trigger the "change" event of the reloaded fields, so please test this issue again and let me know!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
indieben 14 Mar, 2019
Afraid it hasn't Max :-)

Is there anything that you want me to be doing differently from what the manual says between pages 37 - 38? I haven't done the little shortcode bit right at the end as I don't understand what it does and I don't think I need it. Just in case and to save you a bit of time i'll Email you a backup of the form set up. For me, I'm trying to use radios_10 (trigger) to reset radios_12 (target).

Thanks again Max!

N.B - When you update on here please would you ping me the briefest of Emails that you have updated this thread alongside the link here - thanks.
Max_admin 16 Mar, 2019
Hi indieben,

Lets say you have 2 fields, a dropdown and a radio, if the dropdown is set to reload the the radio on "change" (of the dropdown) then once the radio is reloaded, a change event will be triggered for the radio IF the radio has any events set!

But if you want to reset the radio selected values, then you need to reset the radios values in the reload event itself, set the $this->data["radio_name"] = null; in a PHP action, this is because the whole form data is passed to the reload event for processing and the new field will get the same value it had before.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
indieben 16 Mar, 2019
So two questions stem from this,

1) Do I need to remove the current setup as per 37 - 38 of the manual?

2) How do I reference the PHP action in the event?

I presume the custom code block for this also needs to sit in the "setup" area and not the form design view?

Thanks.
indieben 16 Mar, 2019
Tried "radios12", "field_radios12" and also "landline_check" in the custom code block of the event:

<?php

$this->data["radios_12"] = null;

?>

{view:field_radios12}

Also set the code up in a PHP Block within the event and I attempted to call it directly - didn't work.

Other setup as above remains the same currently. I'm really stuck and I'm not a coder.

Thanks.
Max_admin 17 Mar, 2019
Hi indieben,

Your goal is to just reset a radio button when another field value changes, correct ?

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
indieben 17 Mar, 2019
you’ve got it - other than my conditional logic that is always working ?

thanks!
Max_admin 19 Mar, 2019
Hi indieben,

Ok, this should be working as expected, in my "custom code" inside the "reload" event of the radios, I used this code:
<?php
$this->data["radio5"] = "";
?>
{view:field_radios5}
My radios are named "radio5" and the view name is "field_radios5", when the radios group is relaoded the selected value is removed.

If this is not working for you then please create a demo form with the 2 fields and attach it here for testing!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
indieben 27 Jun, 2019
Hi Max, following several updates, has this been made any easier. If so, what's the updated process please?

Thanks ever so much.
Max_admin 04 Jul, 2019
Hi Indieben,

There is a "Clear value" field event now, did you try it ?

Best regards
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.