# Textbox component not saving typed response

**URL:** <https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753>\
**Category:** Builder\
**Tags:** pavlovia\
**Created:** [November 3, 2020, 3:08pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753 "2020-11-03T15:08:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/steve/32/31136_2.png) [@steve](https://discourse.psychopy.org/u/steve)\
**Post date:** [November 3, 2020, 3:08pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/1 "2020-11-03T15:08:59Z")

</div>

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](https://www.youtube.com/watch?v=a9xQlFx5dOQ) but nothing has worked.  
Here is my project:  
[https://pavlovia.org/ben.muzekari/neuroperfect](https://pavlovia.org/ben.muzekari/neuroperfect)

Any help would be great, thanks!

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [November 3, 2020, 4:16pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/2 "2020-11-03T16:16:50Z")

</div>

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 🙂

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

Becca

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/steve/32/31136_2.png) [@steve](https://discourse.psychopy.org/u/steve)\
**Post date:** [November 3, 2020, 4:20pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/3 "2020-11-03T16:20:42Z")

</div>

Hi Becca,

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

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

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/steve/32/31136_2.png) [@steve](https://discourse.psychopy.org/u/steve)\
**Post date:** [November 3, 2020, 4:28pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/4 "2020-11-03T16:28:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [November 3, 2020, 5:00pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/5 "2020-11-03T17:00:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/steve/32/31136_2.png) [@steve](https://discourse.psychopy.org/u/steve)\
**Post date:** [November 3, 2020, 5:02pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/6 "2020-11-03T17:02:47Z")

</div>

Strange. I have added you as a member!

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [November 3, 2020, 7:32pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/7 "2020-11-03T19:32:15Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/steve/32/31136_2.png) [@steve](https://discourse.psychopy.org/u/steve)\
**Post date:** [November 3, 2020, 7:40pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/8 "2020-11-03T19:40:09Z")

</div>

Works perfectly 🙂 Thank you!

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [November 3, 2020, 7:40pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/9 "2020-11-03T19:40:40Z")

</div>

woo! pleased to hear

Becca

---

<div class="post-metadata">

**Author:** ![trishabhugra](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/trishabhugra/32/30448_2.png) [@trishabhugra](https://discourse.psychopy.org/u/trishabhugra)\
**Post date:** [July 27, 2021, 1:39pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/10 "2021-07-27T13:39:46Z")

</div>

@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 🙂  
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.

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [July 28, 2021, 12:42pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/11 "2021-07-28T12:42:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![martamog](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@martamog](https://discourse.psychopy.org/u/martamog)\
**Post date:** [May 30, 2022, 2:54pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/12 "2022-05-30T14:54:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [May 31, 2022, 11:11am UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/13 "2022-05-31T11:11:17Z")

</div>

> [@martamog](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![martamog](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@martamog](https://discourse.psychopy.org/u/martamog)\
**Post date:** [May 31, 2022, 4:22pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/14 "2022-05-31T16:22:11Z")

</div>

Thank you very much Becca, it works perfectly.

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

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [May 31, 2022, 4:46pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/15 "2022-05-31T16:46:19Z")

</div>

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

Becca

---

<div class="post-metadata">

**Author:** ![martamog](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@martamog](https://discourse.psychopy.org/u/martamog)\
**Post date:** [May 31, 2022, 4:52pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/16 "2022-05-31T16:52:50Z")

</div>

> [@martamog](#):
>
> Do you happen to know how to set up the slides? Pavlovia doesn’t read them.

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.

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [May 31, 2022, 5:03pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/18 "2022-05-31T17:03:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![martamog](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@martamog](https://discourse.psychopy.org/u/martamog)\
**Post date:** [May 31, 2022, 6:40pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/19 "2022-05-31T18:40:57Z")

</div>

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](https://psychopy.org/alerts/4405.html)

---

<div class="post-metadata">

**Author:** ![martamog](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@martamog](https://discourse.psychopy.org/u/martamog)\
**Post date:** [July 5, 2022, 10:58am UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/20 "2022-07-05T10:58:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [July 12, 2022, 9:33pm UTC](https://discourse.psychopy.org/t/textbox-component-not-saving-typed-response/17753/21 "2022-07-12T21:33:28Z")

</div>

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
