Textbox component not saving typed response

I am trying to get people to type in emails so I have created a textbox component that reads ‘type email here’. However, after typing the email, the output data is just saving the ‘type email here’ string and not what was typed.
I followed every step from https://www.youtube.com/watch?v=a9xQlFx5dOQ but nothing has worked.
Here is my project:
https://pavlovia.org/ben.muzekari/neuroperfect

Any help would be great, thanks!

Hi There,

I can’t seem to access your project when I click the link - is it set to public? if not you may have to change that setting before we can access it :slight_smile:

You can actually access the demo from that youtube video here if helpful https://gitlab.pavlovia.org/Hirst/textboxdemo

Becca

Hi Becca,

Sorry about that! Here it is again: https://gitlab.pavlovia.org/ben.muzekari/neuroperfect

It should be public now. And thanks I will take a look :slight_smile:

I have taken a look and I can’t seem to spot any major discrepancies between mine project and the demo. Although, mine I am trying run online via Pavlovia but I don’t think that should matter. Can you spot any key differences that may be contributing to the problem?

hi steve - I keep getting a 404 page not found error - please could you double check your privacy settings? alternatively you can ad me as a member to the project whilst I take a look (username is lpxrh6)

Becca

Strange. I have added you as a member!

OK try this. add a code component to your routine where you have the textbox. Then in the ‘endRoutine tab’ enter the following:

thisExp=psychoJS.experiment;
thisExp.addData('this text', textbox_email._pixi.text);

This will save a column in your output file with the header ‘this text’ (change as you wish) and the value of the typed response.

Hope this helps,
Becca

PS. for future users ‘textbox_email’ is the name of the texbox component used

1 Like

Works perfectly :slight_smile: Thank you!

woo! pleased to hear

Becca

@Becca hello! my experiment has 5 sections and in all, I am using the textbox component. In the introductory section and the 2nd part, the textbox component is storing the data perfectly. The remaining columns are blank. I am using image stimuli for the 4 main routines. all of the routines are linked to the same csv file. your help will be appreciated :slight_smile:
Plus unlike the introductory video, you have posted for the textbox component I was unable to use the mouse stimuli because my experiment crashes. I even tried to use the routines from the GitLab you have uploaded. As a solution, I have used the ‘right’ key to submit the response. I hope this is not leading to the issue. If there is a solution for the same let me know. My mouse component works perfectly if i just have to click anywhere on the screen but if it has to click on a particular variable it crashes.

Hi There!

It sounds like there might be a few elements to this (textbox issues, mouse issue) - please could you start a new thread so that we can address these individually? It would be great if you could please provide more info such as the version of PsychoPy you are currently using and if you face the problem locally, online or both - thanks!
Becca

Hi Becca, I have seen that you have been able to solve the problems your colleagues have had with the “Textbox” element in their experiments.

The issue is that in Psychopy the experiment works great (it saves the answers) but when I try to run it in Pavlovia the errors start.

In my experiment the participants have to read a text and then answer 10 questions about it. I have configured it so that on each page they get the question and the text box for them to write. The first question of each text (there are 10 in total) works without any problem, but it doesn’t let them write any more answers until a new text appears.

Can you think of a solution?

Thank you very much.

Have you tried adding a code component with code type “JS” and in the begin routine tab write textbox.refresh() where “textbox” corresponds to the name of your textbox component

Becca

1 Like

Thank you very much Becca, it works perfectly.

Do you happen to know how to set up the slides? Pavlovia doesn’t read them.

Happy to hear that worked! Could you clarify for me what you mean by “slides”? are these image stimuli?

Becca

I have built a slider to make a form and it works in Psychopy (it also registers the answers). But I get an error when uploading it to Pavlovia.

what error do you get? if possible please may you start a new thread for that issue as it sounds a bit different to this topic.

Thanks!
Becca

Hi Becca,

I have tried another experiment and I get the following in Psychopy:

AttributeError: ‘TextBox2’ object has no attribute ‘refresh’
Alert 4405:Editable textbox component textbox_2 and keyboard component key_resp_6 in the same routine may compete for keypresses
For further info see 4405: Textbox and keyboard conflict — PsychoPy v2022.1.4

Hi Becca,

Trying the experiment I realised that you can go forward without giving an answer in the text box.

I’m sorry if this is a " simple" question, but I can’t manage to set it up so that it’s compulsory to answer.

Marta

Hi Marta!

So sorry for my delay picking this up! You should be able to make it compulsory by doing something like the following:

  1. Add a textbox (that is editable)
  2. Add a button to submit the answer
  3. make it so that the onset of the button is “condition” and the field is len(textbox.text)>0

Hope this helps!
Becca