LimeSurvey: master 1d43694f

Author Committer Branch Timestamp Parent
gabrieljenik GitHub master 2020-12-15 23:08:03 master 0bf5e91f
Affected Issues  16895: Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field
Changeset Fixed issue 16895: Question radio button with Question Theme "Bootstrap Buttons" does not keep value in "Other" field (#1683)

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