forms.my_field.errors displaying parentheses on page

43 views
Skip to first unread message

dklin...@gmail.com

unread,
Apr 15, 2021, 11:07:36 AM4/15/21
to oTree help & discussion
Hi,

I'm trying to adapt the "radio_switching_point" app found here:


The form is working fine, the input is captured correctly and the page advances to the next page without error. But the page on the browser displays the characters "()" on the location where the html code is "{{ form.switching_point.errors }}".

In other words, somehow the piece of code "{{ form.switching_point.errors }}" is producing the characters "()" on the page seen by subjects.

If I change the piece of code to " {{ form.errors }}", the characters displayed become "{}".

I'd like to get rid of those characters "()" on the page, but don't know how. Any help is greatly appreciated. 

Thanks,
David

Chris @ oTree

unread,
Apr 15, 2021, 11:18:23 AM4/15/21
to oTree help & discussion
Yes this is a change in oTree 5; see here: https://otree.readthedocs.io/en/latest/misc/otreelite.html#forms
You should do {{ formfield_errors 'switching_point' }}.
I will update that app when I get a chance.

dklin...@gmail.com

unread,
Apr 15, 2021, 11:22:44 AM4/15/21
to oTree help & discussion
Thanks so much, Chris. That solved it.
Reply all
Reply to author
Forward
0 new messages