Check out the LimeSurvey source code on GitHub!

Removing 'onclick' feature from radio buttons.

More
5 years 7 months ago #63369 by COMPGURL
Hello,

I have a set of questions in limesurvey:
1. Date question - user enters their date of birth; their age is computed using JavaScript
2. List (radio) - the date question populates the corresponding radio button based on the age computed in the date question.
3. Third question should display if a specific radio button (question 2) is selected. However, the third question only displays if the user manually clicks on the radio button.

Is there a way to display 'onclick' for a specific list(radio) question in limesurvey?

Please Log in to join the conversation.

More
5 years 7 months ago - 5 years 7 months ago #63393 by tpartner
You will need to fire the noop_checkconditions()function when you set the radio to checked. Something like:
// Select the radio
$(target).attr('checked', true);
 
// Fire the conditions function
var radioValue = $(target).attr('value');
var radioName = $(target).attr('name');
var radioType = $(target).attr('type');
noop_checkconditions(radioValue, radioName, radioType);

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 5 years 7 months ago by tpartner.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form