- Posts: 31
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
hide a cell in array dual scale
- MikeConom
- Topic Author
- Offline
- Junior Member
Less
More
10 years 2 months ago #104194
by MikeConom
hide a cell in array dual scale was created by MikeConom
Good evening
I am trying to hide a cell in array dual scale with following script and to replace it by a numeric cell
but something is rong
I am trying to hide a cell in array dual scale with following script and to replace it by a numeric cell
but something is rong
Code:
var qID = {QID}; var select = '<div id="insertedNo"> \ <input type="numeric-item text-item numberonly" title="" name="no" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001' input.radio').hide(); $('#question'+qID+' .answer_cell_1_001').append(select);
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
10 years 2 months ago - 10 years 2 months ago #104198
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic hide a cell in array dual scale
To return the question ID for a dual scale array you need to use "{self.qid}" (no idea why). And you had a couple of syntax errors.
Try this:
.
Try this:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var qID = {self.qid}; var newSelect = '<div id="insertedNo"> \ <input type="numeric-item text-item numberonly" title="" name="no" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001').append(newSelect); }); </script>
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 2 months ago by tpartner.
The following user(s) said Thank You: MikeConom
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
10 years 2 months ago - 10 years 2 months ago #104203
by DenisChenu
MikeConom, please: can you report this bug to our bug tracker ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic hide a cell in array dual scale
Really strange this issue, {QID} must be allways replaced by the question QID (if use in a question). There are a bug here .tpartner wrote: To return the question ID for a dual scale array you need to use "{self.qid}" (no idea why).
MikeConom, please: can you report this bug to our bug tracker ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 10 years 2 months ago by DenisChenu. Reason: pleae => please
The topic has been locked.
- MikeConom
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 1
10 years 2 months ago #104204
by MikeConom
Replied by MikeConom on topic hide a cell in array dual scale
very clever and with full mystery "{self.qid}"
ok Denis. ill report the bug
Tony thanks
this script working for the col and not for the cell.
how can i hide only the cell?
ok Denis. ill report the bug
Tony thanks
this script working for the col and not for the cell.
how can i hide only the cell?
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
10 years 2 months ago #104212
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic hide a cell in array dual scale
Sorry, I don't understand the 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.
- MikeConom
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 1
10 years 2 months ago #104228
by MikeConom
Replied by MikeConom on topic hide a cell in array dual scale
Tony
Sorry for a short informations
i have attach an icon sample. When i execute the scripr
the first col is hidden and also with my code and the fifth col.
if i want to hide only the first left cell as my red mark, is it possible?
Thanks
Sorry for a short informations
i have attach an icon sample. When i execute the scripr
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var qID = {self.qid}; var newSelect1 = '<div id="insertedNo1"> \ <input type="numeric-item text-item numberonly" title="" name="no1" /> \ </div>'; var newSelect2 = '<div id="insertedNo2"> \ <input type="numeric-item text-item numberonly" title="" name="no2" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001 input.radio').hide(); $('#question'+qID+' .answer_cell_2_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001').append(newSelect1); $('#question'+qID+' .answer_cell_2_001').append(newSelect2); }); </script>
if i want to hide only the first left cell as my red mark, is it possible?
Thanks
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
10 years 2 months ago - 10 years 2 months ago #104230
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic hide a cell in array dual scale
Try this:
.
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var qID = {self.qid}; var newSelect1 = '<div id="insertedNo1"> \ <input type="numeric-item text-item numberonly" title="" name="no1" /> \ </div>'; var newSelect2 = '<div id="insertedNo2"> \ <input type="numeric-item text-item numberonly" title="" name="no2" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001:first input.radio').hide(); $('#question'+qID+' .answer_cell_2_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001:first').append(newSelect1); $('#question'+qID+' .answer_cell_2_001').append(newSelect2); }); </script>
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 2 months ago by tpartner.
The following user(s) said Thank You: MikeConom
The topic has been locked.
- MikeConom
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 1
10 years 2 months ago #104235
by MikeConom
Replied by MikeConom on topic hide a cell in array dual scale
is it the same if i use the following?
Code:
$('#question'+qID+' .answer_cell_1_001:eq(1) input.radio').hide(); $('#question'+qID+' .answer_cell_2_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001:eq(1)').append(newSelect1); $('#question'+qID+' .answer_cell_2_001').append(newSelect2);
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
10 years 2 months ago #104237
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic hide a cell in array dual scale
No, for the first element it would be ":eq(0)" (indexes start at 0).
.
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.