# Editable text box won't return input online

**URL:** https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975
**Category:** Online experiments
**Created:** [October 4, 2020, 2:18pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975 "2020-10-04T14:18:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Noam\_Weinbach](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/noam_weinbach/32/6090_2.png) [@Noam\_Weinbach](https://discourse.psychopy.org/u/Noam_Weinbach)
#### Post date: [October 4, 2020, 2:18pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975/1 "2020-10-04T14:18:57Z")

</div>

URL of experiment: [https://pavlovia.org/Weinbach/text\_box999](https://pavlovia.org/Weinbach/text_box999)

Description of the problem: I wanted to have an editable text box that allows participants to enter a number and this number is stored. While this works offline in psychopy 2020.2.4, when I upload the experiment online to pavlovia, the editable text is not stored in the data file.

Anyone knows what may be the problem?

Thanks,

Noam

---

<div class="post-metadata">

### Author: ![sawal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/sawal/32/10159_2.png) [@sawal](https://discourse.psychopy.org/u/sawal)
#### Post date: [October 4, 2020, 4:00pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975/2 "2020-10-04T16:00:11Z")

</div>

Hi @Noam_Weinbach, this is a known bug in v2020.2.4 (hopefully fixed in 2020.2.5!).

The current work around is to put this line in End Routine of a code component:

```auto
psychoJS.experiment.addData('myTextBox_txt', myTextBox._pixi.text);

```

where ‘myTextBox\_txt’ is the name you want for the textbox output variable, and ‘myTextBox’ is the name of your textBox.

---

<div class="post-metadata">

### Author: ![Noam\_Weinbach](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/noam_weinbach/32/6090_2.png) [@Noam\_Weinbach](https://discourse.psychopy.org/u/Noam_Weinbach)
#### Post date: [October 4, 2020, 7:57pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975/3 "2020-10-04T19:57:35Z")

</div>

Hi sawal,

Thanks so much for your answer. However, after implementing the code, I don’t see the new variable for some reason.

My text box is named “Text\_Number” and this is what I did in the bulider:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/8/f8c7ebf2ecfd8a242d4a755e5373dbc59cc33aad.png)

I uploaded to Pavlovia and made sure the js file was updated:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/0/70440bb444fbecfe58b86cfce11d97752b4cce6d.png)

However, in the data file, I still don’t see the output\_number variable

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/3/b/3b2ede7f9bb16cba593c083da8d359f4c7daec21.png)

Any suggestions?

---

<div class="post-metadata">

### Author: ![sawal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/sawal/32/10159_2.png) [@sawal](https://discourse.psychopy.org/u/sawal)
#### Post date: [October 4, 2020, 8:16pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975/4 "2020-10-04T20:16:22Z")

</div>

Try clearing your browser cache & then running again— sometimes even though js changes show up in gitlab, Pavlovia still doesn’t recognize them

---

<div class="post-metadata">

### Author: ![Noam\_Weinbach](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/noam_weinbach/32/6090_2.png) [@Noam\_Weinbach](https://discourse.psychopy.org/u/Noam_Weinbach)
#### Post date: [October 4, 2020, 8:53pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975/5 "2020-10-04T20:53:54Z")

</div>

Thanks a lot @sawal, that solved it! I would also add for anyone else who tries to do something similar that it is important to add myTextBox.\_pixi.text = ‘’ after the code you mentioned in end of routine if you want the text to clear from trial to trial.

---

<div class="post-metadata">

### Author: ![sawal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/sawal/32/10159_2.png) [@sawal](https://discourse.psychopy.org/u/sawal)
#### Post date: [October 4, 2020, 9:13pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975/6 "2020-10-04T21:13:07Z")

</div>

Happy to help @Noam_Weinbach, cheers!

---

<div class="post-metadata">

### Author: ![Hasademi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/hasademi/32/11425_2.png) [@Hasademi](https://discourse.psychopy.org/u/Hasademi)
#### Post date: [October 29, 2020, 5:33pm UTC](https://discourse.psychopy.org/t/editable-text-box-wont-return-input-online/16975/7 "2020-10-29T17:33:02Z")

</div>

the runner keeps telling me "NameError: name ‘psychoJS’ is not defined  
do I have to put something specific in the psychoJS part?

edit: in the coder I am using both, and when I only used the right side it worked and the text is being saved. Thank you. I don’t know why I didn’t see this post earlier until you shared it on my post.
