Use an answer to prefill another answer

Mehr
7 Jahre 2 Monate her #83167 von amritdeep
In limesurvey workaround i have found the code for
"Use an answer to prefill another answer"

<script>
<!--
function Custom_On_Load(){
document.getElementById('answer1000X11X30').value='{INSERTANS:1000X10X20}';
document.getElementById('answer1000X11X31').value='{INSERTANS:1000X10X21}';
}
-->
</script>



Please tell me where i have to copy this code so that answer of '1000X10X20' copy to 'answer1000X11X30'

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
7 Jahre 2 Monate her - 7 Jahre 2 Monate her #83174 von TMSWhite
You can actually use Expression Manager to use one answer to set the value of another question, even if the other question is in another group (as is the case in your example).

Say your questions are 'a1' (1000X10X20), 'a2' (1000X10X21), 'b1' (1000X11X30), and 'b2' (1000X11X31), you would assign the values this way:
{b1=a1, b2=a2, ''}

This code could be put in a question or help text. Since it uses the comma operator, it returns the final value (''), so nothing will be displayed. You can also call this from either group 10 or group 11, although calling from group 11 will avoid having Expression Manager warn you of potential errors. Lastly, you don't need to put this within a <script>.

Some relevant documentation can be found here .
Letzte Änderung: 7 Jahre 2 Monate her von TMSWhite.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Woche 1 Tag her #188757 von gordonc123
Lets say I have 3 related limeSurvey questions where only one will have any content and the other two questions with no content (null) will be hidden...depending on which one matches the ID of a previous dropdown question.. So I wish to make a question further down the survey that will pull in the contents of the one of the 3 related questions that actually has content. How can I do this? Thanks, Gordon

Gordon Cantor

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Woche 1 Tag her #188758 von Joffm
You should explain a little bit more clearly.
What types of question are involved?
And of course send an example (*.lss) with the relevant questions.

I understand:
First there is a single punch question (drop-down) ("Q1")
Three further questions (what type?) ("Q2", "Q3", "Q4") have a relevance equation depending on Q1, so that only one of them is displayed.
I assume these are questions of type "short text".
Now you want to pipe the content of ("Q2", "Q3", "Q4") into a question ("Q5").

This is quite simple, because two of the question do not have a content, they are empty.
{join(Q2,Q3,Q4)} should do it, meaning all three contents are joined. Because two of them are empty, only the filled content will be piped.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Folgende Benutzer bedankten sich: gordonc123

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Woche 20 Stunden her #188776 von gordonc123
Thank you very much Joffm! That got the value I wanted into question ("Q5") - my issue now is how to get that same value automatically into the ANSWER for "Q5" - so when I export the survey responses (Excel or csv), the question 5 column will contain that value for that survey record.

Gordon Cantor

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Woche 19 Minuten her #188780 von Joffm
So use an question of type equation and pipe this question. You will get a column in the dataset, that contains the value.
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Folgende Benutzer bedankten sich: gordonc123

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha