Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Array with some cells disabled

  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 7 months ago - 8 years 7 months ago #134433 by tammo
Array with some cells disabled was created by tammo
I would like to use an multi-flex-text array with numbers only and disable certain cells.

My Javascript/JQuery capacities are too low, so I would kindly ask one of the gurus to guide me in the right direction.

I hope the attached image tells all. Using 2.50 built 160411



Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 8 years 7 months ago by tammo. Reason: Earlier image not applicable
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago #134439 by tpartner
Replied by tpartner on topic Array with some cells disabled
Hi Tammo, do you want the inputs just disabled (greyed-out) or completely removed?

Can you attach a sample survey containing that question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 7 months ago #134443 by tammo
Replied by tammo on topic Array with some cells disabled
Hi tpartner,

see attachment.

There is an additional wish too: I would like the total of the third question to equal the answer of the second question. Only after that the third question has been answered right.

Example: second question = 56.8

Thanks in advance, this will be my (well, actually your) first Javascript in version 2.5!

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 7 months ago #134444 by tammo
Replied by tammo on topic Array with some cells disabled
@tpartner: Preferably greyed out, but I would also like to know how to remove them completely...


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
8 years 7 months ago #134446 by jelo
Replied by jelo on topic Array with some cells disabled

tammo wrote: see attachment.

Do you mean the png image? Or did you attached a sample survey as tpartner asked for?
Cannot see that sample survey anywhere?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: tammo
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 7 months ago #134448 by tammo
Replied by tammo on topic Array with some cells disabled
Attachment


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
8 years 7 months ago #134454 by DenisChenu
Replied by DenisChenu on topic Array with some cells disabled
Quick test using jquery and EM
In question text
Code:
<script>
$(function() {
    $("answer{SQG}SQ01_SQ01").prop('disabled',true);
});
</script>
Update SQ01 and SQ01 to needed line and column (i never remind if X is first and Y seconc, i think it answer{SQG}SY01_SX01 but unsure.

I don't really understand your second need : but i think it can be done with EM and www.limesurvey.org/manual/Question_type_...28em_validation_q.29

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: tammo
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago #134455 by tpartner
Replied by tpartner on topic Array with some cells disabled

@tpartner: Preferably greyed out, but I would also like to know how to remove them completely

Note that disabling will not work with a mandatory question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: tammo
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago #134462 by tpartner
Replied by tpartner on topic Array with some cells disabled
To avoid confusion, I would change the sub-question codes to reflect the scale. So, something like X1-X15 and Y1-Y4.

Then Denis' script could be:
Code:
<script>
  $(function() {
    $("#answer{SGQ}Y1_X1").prop('disabled',true);
  });
</script>

And, to address your second requirement, the question validation equation could be:
Code:
sum(that.FTE1.sq_Y2) == sum(that.FTE1.sq_Y3)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 7 months ago #134464 by tammo
Replied by tammo on topic Array with some cells disabled
I am standing on the shoulders of giants
en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants

;)


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 6 months ago #135353 by tammo
Replied by tammo on topic Array with some cells disabled
This works very well for an array with texts (where only numbers are allowed).

I now also have another array: array with numbers, checkbox layout. Here the trick does not work.

Anyone knows how to get this working?


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago #135358 by tpartner
Replied by tpartner on topic Array with some cells disabled
Try this:

Code:
<script>
  $(function() {
    $("#cbox_{SGQ}Y1_XA").prop('disabled',true);
  });
</script>


File Attachment:

File Name: limesurvey...4_TP.lss
File Size:44 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: tammo
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose