LimeSurvey: 3.x-LTS 665c34d5

Author Committer Branch Timestamp Parent
gabrieljenik GitHub 3.x-LTS 2020-12-14 11:49:41 3.x-LTS d049d014
Affected Issues  16849: Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field
Changeset

Fixed issue 16849: Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field (#1681)

There were two problems:
1) The 'other' answer value from the DB was never used by the theme to feed it into the screen ($answer_other was not used in answer_row_other.twig).
2) The show/hide code is part of the radio's 'change' event, which was only trigger on an actual change, not initially to setup the screen

An additional problem is that, in this theme, the 'other' input control is outside the scope of answer_row_other.twig, so the value cannot be directly assigned when rendering. Instead, a hidden input had to be added to hold the value until it can be transfered by javascript to the actual control.

At last, as the doBootstrapRadio is called multiple times (once per question in the screen), the event assignment happens multiple times as well.

mod - themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.js Diff File
mod - themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row_other.twig Diff File