Welcome, Guest
Username: Password: Remember me

TOPIC: Removing 'onclick' feature from radio buttons.

Removing 'onclick' feature from radio buttons. 3 years 4 months ago #63369

  • COMPGURL
  • COMPGURL's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
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?
The administrator has disabled public write access.

Re: Removing 'onclick' feature from radio buttons. 3 years 4 months ago #63393

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4371
  • Thank you received: 829
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 3 years 4 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu
Moderators: ITEd
Time to create page: 0.103 seconds
Donation Image