- Posts: 18
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
// Set the input masks $('tr.subquestion-list[id="javatbd376637X9X{QID}SQ002"] input[type="text"]', thisQuestion).inputmask('financial');
// Set the input masks $('tr.subquestion-list[id="javatbd{SGQ}SQ002"] input[type="text"]', thisQuestion).inputmask('financial');
// using answer code var gender = '{Qgender.NAOK}'; if (gender == 'GIRL') { // do something } if (gender == 'BOY') { // do something }
// using answer option text var gender = '{Qgender.shown}'; if (gender == 'Marie-Sophie') { // do something } if (gender == 'Jean-Pierre') { // do something }
No,ervit wrote: I see...
Is it possible to create some sort of JS function that takes a question ID as an argument and returns that question's SGA code? (I'm sure someone must have done it before)
DenisChenu wrote: If you use it in another question :
{QCODE.qid} : replaced by the question id of the question with title QCODE
{QCODE.sgq} : same with SGQ
// Identify this question var thisQuestion = $('#question{QID}');
// Identify that question var thatQuestion = $('#question{P1UnitSales.qid}');
// Identify that question var thatQuestion = $('#question{that.P1UnitSales.qid}');
Ben_V wrote: I think it's not possible but you can manage question codes or answer text for this...
For example, you can use the following syntax to set some js based on a response to a previous radio button question:
q code: "Qgender"
2 answer options:
=> "code" (text)
a) "GIRL" (Marie-Sophie)
b) "BOY" (Jean-Pierre)
Code:// using answer code var gender = '{Qgender.NAOK}'; if (gender == 'GIRL') { // do something } if (gender == 'BOY') { // do something }Code:// using answer option text var gender = '{Qgender.shown}'; if (gender == 'Marie-Sophie') { // do something } if (gender == 'Jean-Pierre') { // do something }
var ceoDir = "{MgmtPositions_SQ001.NAOK}";
"<span id='LEMtailor_Q_54_128'>Y</span>"
$("<html>actual text</html>").text();