- Posts: 55
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Array text
- AntPIC
- Topic Author
- Offline
- Senior Member
Less
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?
C'è un'equazione possibile?
Please Log in to join the conversation.
- AntPIC
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
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
Grazie
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12925
- Thank you received: 3977
2 years 2 months ago #225254
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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:
Joffm
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>
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
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
2 years 2 months 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.
Please Log in to join the conversation.
- AntPIC
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
2 years 2 months 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
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12925
- Thank you received: 3977
2 years 2 months ago #225326
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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
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
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
2 years 2 months 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
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12925
- Thank you received: 3977
2 years 2 months ago #225330
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
2 years 2 months ago #225335
by AntPIC
Replied by AntPIC on topic Array text
Ecco il file.
Please Log in to join the conversation.
- AntPIC
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
2 years 2 months 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
Analogamente in un'altra array text vorrei limitare l'inserimento in die colonne di soli numeri o lasciarle vuote. Ma non capisco dove sbaglio
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12925
- Thank you received: 3977
2 years 2 months ago - 2 years 2 months ago #225349
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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ù
(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 2 months ago by Joffm.
Please Log in to join the conversation.
- AntPIC
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
2 years 2 months ago #225352
by AntPIC
Replied by AntPIC on topic Array text
Sono sicuramente io incapace, ma non funziona.
(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')
(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.