Welcome, Guest
Username: Password: Remember me

TOPIC: Custom check boxes and radio buttons

Custom check boxes and radio buttons 3 years 8 months ago #54352

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2610
  • Thank you received: 302
  • Karma: 112
Hi!

I finally found the time to play around with this workaround:
docs.limesurvey.org/tiki-index.php?page=...ttons_and_checkboxes

However, I can't manage to get it work.

What I did so far:

Step 1. I turned off $filterxsshtml (which is standard in my installation)

Step 2. Set up the template to use custom onload functions. --> here I am not quite sure what to do. I just don't understand what is meant with setting up the template here. In the explanation there is just shown how a onload function should look like, but not how to set-up the template. So here might be my problem.

Step 3. The imagetick.js has been placed into the template folder, together with check.gif, no_check.gif, no_radio.gif, radio.gif

Step 4. I also added this code to the header of my template

Step 5. I also added the code in the question code.

There is one other question: wouldt the code from step 5 work if included in the startpage.pstpl as well? I ask because if you would want to have the checkboxes substituted for the whole questionnaire, this would be a lot more confortable.

So I was wondering what I am doing wrong here. There just happens nothing. No error message, but also the checkboxes and radio buttons stay the same.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54353

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5324
  • Thank you received: 293
  • Karma: 248
Please ping Tony, he is the expert for this one.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54354

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2610
  • Thank you received: 302
  • Karma: 112
Yeah, I know. However, as he hangs around here quite a bit, I thought there is no need to "ping" him. If he doesn't show up the next few days, I might ping him though.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54362

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2610
  • Thank you received: 302
  • Karma: 112
Hmm, I somehow got this pixelmatrixdesign.com/uniform/ to work. But only somehow. It looks good, except for the the radio buttons. For the radio buttons there are two problems, they don't have a functionality (can't be marked) and they are somehow off to the left. Buttons and checkboxes do work though.

Let's see if we can make this work. Looks good at least. ;-)

And I there is another problem: the progress bar doesn't work anymore. Weird.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Last Edit: 3 years 8 months ago by holch.
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54364

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2610
  • Thank you received: 302
  • Karma: 112
OK, this is how far I got. Here an example survey:
www.ivp-surveys.com/sc/091SL/index.php?sid=29851&lang=en

It works so far that it substitutes check boxes, text boxes, buttons, radio buttons and selects.

However, I have found the following problems so far:
- Needed to reference jquery. I did this with a link to the Google API, which is of course not ideal and causes errors with the ssl certificate. I have to see how I best reference the internal jquery.
- the progress bar doesn't show correctly anymore - strange.
- the radio buttons show up, but don't work and are quite a bit off to the left
- there are 2 pages at the beginning, which I don't know yet where they come from.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54365

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2610
  • Thank you received: 302
  • Karma: 112
Found out what the two pages at the beginning are for: welcome message and group description. In my custom template they are display:none, thus there are 2 empty pages.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54400

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4120
  • Thank you received: 760
  • Karma: 346
Holch, I'm not familiar with that plugin but it looks like you have a jQuery conflict. Can you attach a sample survey? I'll play with it later today.
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.
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54402

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2610
  • Thank you received: 302
  • Karma: 112
Hi Tpartner!

Could be that this a conflict between the different versions of Jquery, as there is the version that is included in Limesurvey and the one that I have externally referenced. I needed to reference the external one, because I didn't know how to reference the internal one in the template. And without referencing it, it did nothing.

I chose that plugin, because the other one from the workaround just did nothing for me, while the Uniform one was at least doing something from the beginning, so I could go step by step to get rid of some errors until I got to this point. Additionally, the method looks a lot simpler to me, because it works template wide and you don't have to add code in the question texts. Additionally it not only substitutes the radio buttons and check boxes, but also other input types. Additionally it looks quite nice out of the box.

Here the sample survey:

[wrong survey uploaded]

I assume, once I figure out how to reference the shipped Jquery it might work better. Additionally it won't create a problem with the ssl certificate for including external files.

At the moment I have included the UNIFORM plugin files in the template folder. But I think it would be good to include it in the standard Jquery folder, wouldn't it? But then again, I don't know how to reference it in the template files.
Attachments:
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Last Edit: 3 years 8 months ago by holch.
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54403

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2610
  • Thank you received: 302
  • Karma: 112
Here the correct version:

File Attachment:

File Name: limesurvey_survey_29851_2.lss
File Size: 30047
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Custom check boxes and radio buttons 3 years 8 months ago #54412

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6256
  • Thank you received: 799
  • Karma: 239
holch wrote:
OK, this is how far I got. Here an example survey:
www.ivp-surveys.com/sc/091SL/index.php?sid=29851&lang=en
I see $("#progressbar").progressbar is not a function
Fichier Source : www.ivp-surveys.com/sc/091SL/index.php
Ligne : 46

You put whole jquery-ui.js on comment ?

If i look to your jquery-ui.js file, then all function are commented. :unsure:

Progress bar function need jquery-ui.

:)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.147 seconds
Donation Image