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

Ajax form element validation quirk

Bauer

Well-Known Member
I have a form with 2 elements initially visible - a radio button (shown as a button group) and a dropdown select. (See attachment)

In this case...
The user changed the 'Hospital System?' radio button from the default 'Not a Hospital System' to 'Single Diversified Hospital System' - which then shows the dropdown for selecting or adding the name of that Hospital System.

If a hospital is selected from that dropdown, validation passes. :)

And if the user then changes the dropdown back to the 'Please select' option (or the users saved the form without selecting from the dropdown), the selected Hospital System is zero and it fails validation.
All that is as it should be. :)

The problem is, when the form gets repainted to show that failed validation, the radio button shows the default value ('Not a Hospital System') rather than what was last selected ('Single Diversified Hospital System') - which is the reason the validation failed to begin with. (Again, see attachment)

Hence, the form as presented to the user is confusing - because it shows the supposed errors in red yet the values as shown would be a valid submission.

What should happen is that the form gets repainted with the 'Hospital System?' radio button selector set to the last selected value ( that was part of what caused the failed validation) - but it gets repainted showing the default value (if new), or in an edit (I believe) the value gets reset to the last saved value at the time of the last edit.

This is why I rarely use Ajax validation - it just doesn't always work as expected. :(

Can't you fix this so that when the form gets repainted after validation and there is a validation error, the elements that passed validation show their last changed value rather than their default value (or value from when last saved)?

There is also a long-standing issue with the Fabrik ?Toggle submit? feature which basically makes it unusable. If I get some time over the weekend, I'll create a new thread to explain that one.
 

Attachments

  • validationQuirk.png
    validationQuirk.png
    56.6 KB · Views: 24
Is it the same if you are using standard radio buttons instead of button group?
Which Fabrik and Joomla version?
 
Is it the same if you are using standard radio buttons instead of button group?
Which Fabrik and Joomla version?
Yes. If radio button group is not used and 'Single Diversified Hospital System' is selected, if the form is submitted without first selecting an option from the dropdown, the results of the failed validation are the same.

The radio button selector reverts to the default value of 'Not a Hospital System' (as shown in attachment).
 

Attachments

  • RadiobuttonQuirk.png
    RadiobuttonQuirk.png
    43 KB · Views: 19
As usual, I can't replicate this.

I have an AJAX-ified (popup) form. A radio button, and a dropdown. The dropdown has a "not equal 0" validation. I can open the form, change the radio button, leave the dropdown at 0, it fails validation, and the radio retains its selection. Change the radio selection, try again, retains selection. Change dropdown, submit form, submits, edit it again, still works as expected With or without being a button group. Edit or new.

If you try this on a simple test form with just a radio and a dropdown, does it behave the same?

-- hugh
 
It's working on my site, too.
So:
Which Joomla, Fabrik, Joomla template, Fabrik template?
JS errors?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top