Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Centering "No Answer" Radio Button Option

Centering "No Answer" Radio Button Option 2 years 10 months ago #101282

  • abryenton
  • abryenton's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Hi everyone,

I'm trying to center the radio buttons on a Array (flexible labels). There doesn't seem to be a class attached to them.

Any ideas?

Last Edit: 2 years 10 months ago by abryenton.
The administrator has disabled public write access.

Centering "No Answer" Radio Button Option 2 years 10 months ago #101294

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6321
  • Thank you received: 1407
  • Karma: 547
In LS 2.0, that <td> element has a class "noanswer-item".
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Centering "No Answer" Radio Button Option 2 years 10 months ago #101296

  • abryenton
  • abryenton's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
We are currently using Limesurvey 1.87.

How would I go about adding that class to that element in this version?

Thanks!
Aaorn
The administrator has disabled public write access.

Centering "No Answer" Radio Button Option 2 years 10 months ago #101297

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6321
  • Thank you received: 1407
  • Karma: 547
I can't test on a version that old but try adding this to the end of template.js:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() { 
		$('.array-flexible-row input.radio[value=""]').closest('td').addClass('noanswer-item');  
    });
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Centering "No Answer" Radio Button Option 2 years 10 months ago #101299

  • abryenton
  • abryenton's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
That's awesome!! Thank you so much!

It didn't work in the template.js so I just added it to the startpage.pstpl and it worked great!

Thanks again!
Aaron
The administrator has disabled public write access.

Centering "No Answer" Radio Button Option 2 years 10 months ago #101300

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6321
  • Thank you received: 1407
  • Karma: 547
Oops, sorry, my mistake - you don't need the enclosing <script> tags in template.js.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Centering "No Answer" Radio Button Option 2 years 10 months ago #101302

  • abryenton
  • abryenton's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Not a problem, thanks again for the help! Much appreciated. :)
The administrator has disabled public write access.
Time to create page: 0.283 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form