Welcome to the LimeSurvey Community Forum

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

Pjax scriptcomplete/Iquery: can't transfer html property into next question

  • Finn Marten
  • Finn Marten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 months 4 weeks ago #264767 by Finn Marten
Dear forum members,

I struggle with the following problem:
1. I fill an aray type question with randomized text input with pjax scriptcomplete. The array is of no importance and serves only for randomization of text inputs for follow up questions. It will later be hidden. The text input can be something like "Scenario 2", where I want to highlight the number two. I create different text inputs and a function that chooses a single text input per field in the array (choice). I can display the text input in the array with code like this:

Code # 1        $('#question{QID} tr[id^="javatbd"]:eq(2) td:eq(0)').html(choiceA2[0]);     this displays: "Scenario 2"

I have also experimented with code like this: 

Code # 2       $('#question{QID} tr[id^="javatbd"]:eq(1) input[type="text"]:eq(0)').val(choiceB1[0]);    which displays: "Scenario <b>2</b>"


2. I try to display the text inputs in an html table in a second question with pjax scriptcomplete but for Code #1 nothing is displayed at all. For code #2 it displays  "Scenario <b>2</b>" once again. I am looking for a way to display the text input with the number actually beeing shown in bold: "Scenario 2". After days of research in forums, tutorials and elsewhere I decided to ask for a little advice here. I would be deeply thankful for any advice or comments. I attached a lss file with a mock survey than contains my problem. The underlying code for creating the array is in the question QPP and the code for displaying the html table is in question Q1. Hopefully someone knows the remedy to my problems. Thanks in advance.

 

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose