Set Variable with contents of a Text Field

How can I Set a Variable to the contents of a text field.


What i want is for them to build up a sentence by clicking on a set of fields, which i could then output.


Any ideas pleas?

Discussion (2)

Has anyone solved this challenge? I too would like to know :)

I finally figured it out.

1. set up a variable in Lectora (I'll call it fromField)

2. set up a text field in lecotra and put text in it and note its ID (mine is text38)

2. on a trigger, such as a button click run the following JavaScript.

3. x=document.getElementById("text38").textContent;

VarfromField.set(x);

You just set the Lectora variable fromField tot he contents of text38.

Discussions have been disabled for this post