Explore the community Forums Lectora Tips and tricks Get text box value to variable

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #284046 Score: 0
    Profile photo of insaman

    I have a test where each question have two feedbacks, one for correct and one for incorrect answer.

    When the user is done with the test I’m want all feedbacks from the incorrect answers collected together with the question string on a summary page.
    But I can’t manage to get the string from my feedback text box to a variable. I’ve tried with creating a new variable that I change conent on and I’m then adding the text box name to my feedback variable, but no dice…

    Is there anybody here that have tried something simular and got it to work?


    / Kent

    #288177 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    friend finder
    lab member
    junior moderator
    LUC16 Attendee
    wise owl
    339 pts

    Hej-hej! 🙂

    I don’t think you can (easily*) get contents of a textbox into a variable. But you can easily get the contents of a variable into a textbox. So you should create a variable called e.g. “Negative_Feedback_1” and then add an action to your hidden feedback textbox: “On Show -> Change Contents -> This textbox -> To Variable Negative_Feedback_1”.

    In other words, you keep your feedbacks in variables from the very beginning and change textbox contents when you need it. And on your grand feedback page, you simply use the feedback texts from the variables.

    * Or you can use JavaScript to grab the textbox contents and put it into a variable.

    Let me know if it made sense 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.