oTree Forum >

error: Bot submission failed form validation:

#1 by AJafarzadeh ,

I am running the test for my app, but there is this error. I cannot understand what I should do. 
the error is this:
"Page "Taking": Bot submission failed form validation: ["taking_offer_1: ['This field is required.']"] Check your bot code, then create a new session. Data submitted was: {'taking_offe_1': '4'}"

Taking page is a simple page, but there is only if in the HTML page: 
  {{if player.round_number == 3}}
        {{formfield player.taking_offer_1}}
    {{else}}
        {{formfield player.taking_offer_2}}
    {{endif}}

In programming of my page init page, I definde formfield: 
    @staticmethod
    def get_form_fields(player):
        if player.round_number == 3:
            return [ 'taking_offer_1' ]
        elif player.round_number == 6:
            return [ 'taking_offer_2' ]
Could you please help me solve this erro when I run the test? (the program works well, but I need to test it in large scale).

#2 by Chris_oTree ,

It's just a typo:

taking_offer_1
taking_offe_1

#3 by AJafarzadeh ,

Thank you Chris! I was blind for a couple of days! Now it is working!

Write a reply

Set forum username