Welcome to the LimeSurvey Community Forum

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

Array text

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 2 months ago #225244 by AntPIC
Array text was created by AntPIC
Salve, ho una domanda array text a tre colonne e vorrei che nella seconda colonna vorrei che la validazione avvenga solo se indica Sì o No.
C'è un'equazione possibile?

Please Log in to join the conversation.

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 2 months ago #225252 by AntPIC
Replied by AntPIC on topic Array text
Altra domanda è se nelle due colonne della array text è possibile limitare l'inserimento del testo "Sì", "No" o lasciarlo vuoto.
Grazie

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago #225254 by Joffm
Replied by Joffm on topic Array text
Due soluzioni:
1: Con equazione di convalida

equazione:
(is_empty(self.sq_Y001_X002) or strtoupper(self.sq_Y001_X002)=="SI" or strtoupper(self.sq_Y001_X002)=="NO") and (is_empty(self.sq_Y002_X002) or strtoupper(self.sq_Y002_X002)=="SI" or strtoupper(self.sq_Y002_X002)=="NO") and (is_empty(self.sq_Y003_X002) or strtoupper(self.sq_Y003_X002)=="SI" or strtoupper(self.sq_Y003_X002)=="NO") and (is_empty(self.sq_Y004_X002) or strtoupper(self.sq_Y004_X002)=="SI" or strtoupper(self.sq_Y004_X002)=="NO")

2: Con campo a drop-down
 
javascript:
Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
    var thisQuestion = $('#question{QID}');
    // Add a question class
    thisQuestion.addClass('custom-array');
 
    // Column-specific classes
    $('table.subquestion-list tr', thisQuestion).each(function(i) {
      $('th, td', this).each(function(i) {
        $(this).addClass('column-'+i);
      });
    });
 
 
    // Insert selects
    $('.answer-item.answer_cell_X002', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
  <option value="">...</option>\
  <option value="1">Si</option>\
  <option value="2">No</option>\
</select>');
 
    // Listeners
    $('.inserted-select', thisQuestion).on('change', function(i) {
      if($(this).val() != '') {
        $(this).closest('.answer-item').find('input:text').val($('option:selected', this).val()).trigger('change');
      }
      else {
        $(this).closest('.answer-item').find('input:text').val('').trigger('change');
      }
    });
 
  // Returning to page
    $('.with-select input:text', thisQuestion).each(function(i) {
      var thisCell = $(this).closest('.answer-item');
      var inputText = $.trim($(this).val());
      $('select.inserted-select', thisCell).val(inputText);
    });
 
    // Clean-up styles
    $('select.inserted-select', thisQuestion).css({
      'max-width': '100%'
    });
    $('.with-select input:text', thisQuestion).css({
      'position': 'absolute',
      'left': '-9999em'
    });
  });
</script>

 

File Attachment:

File Name: limesurvey...3573.lss
File Size:25 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: lfanfoni

Please Log in to join the conversation.

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 1 month ago #225324 by AntPIC
Replied by AntPIC on topic Array text
Grazie ma  ho provato ad inserire le condizioni ma non mi funzionano. Allego il file. 

This browser does not support PDFs. Please download the PDF to view it: Download PDF


 

Please Log in to join the conversation.

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 1 month ago #225325 by AntPIC
Replied by AntPIC on topic Array text
Grazie mille ma la formula non mi funziona e non capisco dove sbaglio. Allego il file di logica se può darmi una mano

File Attachment:

File Name: survey_logic_file.zip
File Size:95 KB
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 1 month ago #225326 by Joffm
Replied by Joffm on topic Array text
Buongiorno,
1. per favore, invia sempre un lss export
2. Dove l'hai inserito?
 

Qui?
 

Non è un "RegEx", è una "Equazione di convalida della domanda",
Questo è inserito qui.
 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 1 month ago #225329 by AntPIC
Replied by AntPIC on topic Array text
Grazie ancora. Ora non mi restituisce errore. Ma non funziona i controllo. Ossia nei campi posso inserire qualsiasi valore. Allego il file se può aiutarmi. Grazie per la pazienza
 

File Attachment:

File Name: limesurvey... (2).lsq
File Size:14 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 1 month ago #225330 by Joffm
Replied by Joffm on topic Array text
lss, no lsq

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 1 month ago #225335 by AntPIC
Replied by AntPIC on topic Array text
Ecco il file. 

File Attachment:

File Name: limesurvey...1758.lss
File Size:392 KB

Please Log in to join the conversation.

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 1 month ago #225346 by AntPIC
Replied by AntPIC on topic Array text
Mi sono solo limitato a cambiare a modificare i codici dalla formula, ma non mi funziona.
Analogamente in un'altra array text vorrei limitare l'inserimento in die colonne di soli numeri o lasciarle vuote. Ma non capisco dove sbaglio 

File Attachment:

File Name: limesurvey...1758.lss
File Size:392 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 1 month ago - 2 years 1 month ago #225349 by Joffm
Replied by Joffm on topic Array text
Avevo scritto questo
(is_empty(self.sq_Y001_X002) or strtoupper(self.sq_Y001_X002)=="SI" or strtoupper(self.sq_Y001_X002)=="NO") and
(is_empty(self.sq_Y002_X002) or strtoupper(self.sq_Y002_X002)=="SI" or strtoupper(self.sq_Y002_X002)=="NO") and
(is_empty(self.sq_Y003_X002) or strtoupper(self.sq_Y003_X002)=="SI" or strtoupper(self.sq_Y003_X002)=="NO") and
(is_empty(self.sq_Y004_X002) or strtoupper(self.sq_Y004_X002)=="SI" or strtoupper(self.sq_Y004_X002)=="NO")

Hai inserito questo
(is_empty(self.sq_SQ005_SQ002) or strtoupper(self.sq_SQ005_SQ002)=='SI' or strtoupper(self.sq_SQ005_SQ002)=='NO') or
(is_empty(self.sq_SQ006_SQ002) or strtoupper(self.sq_SQ006_SQ002)=='SI' or strtoupper(self.sq_SQ006_SQ002)=='NO') or
(is_empty(self.sq_SQ007_SQ002) or strtoupper(self.sq_SQ007_SQ002)=='SI' or strtoupper(self.sq_SQ007_SQ002)=='NO') or
(is_empty(self.sq_SQ008_SQ002) or strtoupper(self.sq_SQ008_SQ002)=='SI' or strtoupper(self.sq_SQ008_SQ002)=='NO') or

Joffm

E qui solo il RegEX, niente di più
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 1 month ago by Joffm.

Please Log in to join the conversation.

  • AntPIC
  • AntPIC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 1 month ago #225352 by AntPIC
Replied by AntPIC on topic Array text
Sono sicuramente io incapace, ma non funziona. 

File Attachment:

File Name: limesurvey... (1).lss
File Size:403 KB

(is_empty(self.sq_SQ005_SQ002) and strtoupper(self.sq_SQ005_SQ002)=='SI' and strtoupper(self.sq_SQ005_SQ002)=='NO') and (is_empty(self.sq_SQ006_SQ002) and strtoupper(self.sq_SQ006_SQ002)=='SI' and strtoupper(self.sq_SQ006_SQ002)=='NO') and (is_empty(self.sq_SQ007_SQ002) and strtoupper(self.sq_SQ007_SQ002)=='SI' and strtoupper(self.sq_SQ007_SQ002)=='NO') and (is_empty(self.sq_SQ008_SQ002) and strtoupper(self.sq_SQ008_SQ002)=='SI' and strtoupper(self.sq_SQ008_SQ002)=='NO') and (is_empty(self.sq_SQ009_SQ002) and strtoupper(self.sq_SQ009_SQ002)=='SI' and strtoupper(self.sq_SQ009_SQ002)=='NO') and (is_empty(self.sq_SQ005_SQ003) and strtoupper(self.sq_SQ005_SQ003)=='SI' and strtoupper(self.sq_SQ005_SQ003)=='NO') and (is_empty(self.sq_SQ006_SQ003) and strtoupper(self.sq_SQ006_SQ003)=='SI' and strtoupper(self.sq_SQ006_SQ003)=='NO') and (is_empty(self.sq_SQ007_SQ003) and strtoupper(self.sq_SQ007_SQ003)=='SI' and strtoupper(self.sq_SQ007_SQ003)=='NO') and (is_empty(self.sq_SQ008_SQ003) and strtoupper(self.sq_SQ008_SQ003)=='SI' and strtoupper(self.sq_SQ008_SQ003)=='NO') and (is_empty(self.sq_SQ009_SQ003) and strtoupper(self.sq_SQ009_SQ003)=='SI' and strtoupper(self.sq_SQ009_SQ003)=='NO')

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose