# Wakefield's Daily Tips

**URL:** <https://discourse.psychopy.org/t/wakefields-daily-tips/43371>\
**Category:** Blog\
**Tags:** online, pavlovia\
**Created:** [January 1, 2025, 3:36pm UTC](https://discourse.psychopy.org/t/wakefields-daily-tips/43371 "2025-01-01T15:36:55Z")\
**Posts on this page:** 1\
**Showing post:** 117

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [October 12, 2025, 9:26am UTC](https://discourse.psychopy.org/t/wakefields-daily-tips/43371/117 "2025-10-12T09:26:09Z")

</div>

## Setting the contents of an editable textbox

If you want participants to be able to type into a textbox but edit the contents of the textbox.text column in the data file, you will need to make the edit in **Each Frame** code as the routine is ending.

This is an exception to the rule that code components should go at the top of the routine. For this to work I would recommend putting this code component at the bottom since it will need to go below both the textbox component and the component or code that is ending the trial.

The following code will set textbox.text as “Empty” if the routine ends with a blank textbox.

**Each Frame**

```auto
if continueRoutine == False:
    if not textbox.text:
        textbox.text = "Empty"

```

Note that any component that forces a routine to end, sets the variable “continueRoutine” to False. This variable is checked at the end of each frame.

> [@Save textbox text when no answer is given](https://discourse.psychopy.org/t/save-textbox-text-when-no-answer-is-given/45782):
>
> OS (e.g. Win10): PsychoPy version (e.g. 2025.1.0 Py 3.10): Standard Standalone Installation? (y/n) Y Do you want it to also run online? (y/n) Y What are you trying to achieve?: I am updating my change blindness experiment so that it uses the textbox component to save written answers instead of using code. Textbox answers are saved. However, sometimes participants either do not recognise the change or do not provide an answer. Currently, nothing is saved in these cases. I would like to save…

---

_[View the full topic](https://discourse.psychopy.org/t/wakefields-daily-tips/43371)._
