formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.89k stars 1.06k forks source link

How force to update form on event. #1578

Closed daebak74 closed 2 years ago

daebak74 commented 5 years ago

Hello, I am using render form 3.x and I need to give hte possibility to uncheck radio input. The click event is triggered only in check state. How I can force the triggerChange on unselect.

I appreciate any suggestion.

Formio.createForm(document.getElementById('formrender'), data).then(function(form) {
$('#formrender input:radio').each(function(event) {

                                $(this).on('click', function (event) {

                                    if (event.ctrlKey) {
                                        $(this).prop('checked', false);
                                        'HERE NEED THE TRIGGER CHANGE'
                                    }

                                });

                            });
});

Thanks!

heather-formio commented 2 years ago

Closing this thread as it is stale. Please feel free to reopen if needed.