| Reference | Downloads | Github

Input field options?


I would need to insert an input field in my online experiment. I have searched through the forum and people have come up with some sort of work around.

I was wondering if there is any implemented way to have a text input field within a routine of an online experiment or that is something that is not available just yet.



Yes, you can create your own text input using a text component. See the online demo we have available on Pavlovia:

Refer to a string array that is smaller that the trial array in the same loop?

Thanks for this @dvbridges!!

I noticed two small issues.

  1. The period button will be printed as period and not as a actual period .
  2. How to prevent subjects to just press ‘return’ to end the routine. I want to make sure they are going to actually answer the question without leaving unanswered.

I guess that’s something that must be done in the definition of the textAdd variable…


Sure, its just a demo, it does not cover all keys, but shows you how you would deal with any key press you would like to handle. For the second question, you need to make sure that the text component contains text before allowing return to end a trial e.g., something like if (key == 'return' && text.text.length > 0).

1 Like

Out of pure curiosity - how will it work if I wanted to have symbols like ? and ! printed in the textAdd variable?